A requirements.txt file is a plain-text dependency list for a Python project. It lets pip install the project’s third-party packages together instead of installing them one at a time. section 2.1.1
Use the file to make Python environments repeatable:
- Create requirements.txt in the project source folder. section 2.1.1
- List one third-party package per line, optionally declaring specific versions. section 2.1.1
- With the virtual environment activated, run python -m pip install -r src/requirements.txt to restore the dependencies. section 2.1.1
- Keep the virtual environment out of Git; requirements.txt records what can recreate it. section 2.3.2
FastAPI dependency list
fastapi jinja2 uvicorn gunicorn Install the complete list with: python -m pip install -r src/requirements.txt section 2.1.1
Listing 2.5 FastAPI requirements.txt
fastapi jinja2 uvicorn gunicorn
Shows a minimal requirements.txt for the Python web application. section 2.1.1



