Installation#

Requirements#

$ pipenv install fastapi
Adding fastapi to Pipfile's [packages]…
✔ Installation Succeeded
Locking [dev-packages] dependencies…
✔ Success!
Locking [packages] dependencies…
✔ Success!

Optional requirements#

For production you also need an ASGI server, such as uvicorn:

$ pipenv install uvicorn
Adding uvicorn to Pipfile's [packages]…
✔ Installation Succeeded
Locking [dev-packages] dependencies…
✔ Success!
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (051f02)!

Pydantic can use the optional dependencies

ujson

for faster JSON parsing.

email_validator

for email validation.

Starlette can use the optional dependencies

httpx

if you want to use the TestClient.

aiofiles

if you want to use FileResponse or StaticFiles.

jinja2

if you want to use the default template configuration.

python-multipart

if you want to support form parsing, with request.form().

itsdangerous

required for SessionMiddleware support.

pyyaml

for Starlette’s SchemaGenerator support.

graphene

for GraphQLApp support.

ujson

if you want to use UJSONResponse.

orjson

if you want to use ORJSONResponse.

They can be installed, e.g. with:

$ pipenv install fastapi[ujson]

Alternatively you can install all of these with:

$ pipenv install fastapi[all]