Deployment Dependencies

Learn to install the FastAPI and Uvicorn packages for deployment.

We'll cover the following

This lesson will guide us through the installation of the FastAPI and Uvicorn packages in our virtual environment.

Uvicorn

Uvicorn is an open source asynchronous sver gateway interface (ASGI) webserver implementation for Python. It complements FastAPI for building RESTful APIs.

The standard installation includes Cython-based dependencies and other optional packages such as:

  • websockets: This is the support for the WebSocket protocol.
  • watchgod: This reloads the server on file modifications.
  • colorama: This is the colorful logs for Windows users.
  • pyyaml: This is the support for YAML configuration files.

Install it like this:

pip install uvicorn[standard]

For pure Python dependencies, install it as follows:

pip install uvicorn

FastAPI

FastAPI is the backbone of our model deployment. It is an open source web framework for building APIs. For minimal installation, run the following command in the terminal:

pip install fastapi

python-multipart

FastAPI uses JSON as the default standard for input and output. The python-multipart package provides support for form submission. It allows us to send files, such as images and audio.

Install it as follows:

pip install python-multipart

Get hands-on with 1400+ tech skills courses.