Page cover

πŸ’ΎUnit 4: Install FastAPI

Creation of virtual environments

A virtual environment is created on top of an existing Python installation, known as the virtual environment’s "base” Python, and may optionally be isolated from the packages in the base environment, so only those explicitly installed in the virtual environment are available.

There is a wide range of virtual environment modules in Python:

Python must be installed on your computer before installing virtual environment modules. For macOS, you can take advantage of Homebrew to install virtual environment modules.

Taking virtualenvwrapper as an example:

  • To install, execute this command in CMD/Terminal: pip install virtualenvwrapper

  • To create a new virtual environment: mkvirtualenv env1

  • To deactivate a virtual environment: deactivate

  • You can refer to this document to discover more useful commands in virtualenvwrapper.


Install FastAPI

For the tutorial, you might want to install FastAPI with all the optional dependencies and features, by executing the below command in a virtual environment:

pip install "fastapi[all]"

Last updated