requirements.txt is the conventional Python file for listing the packages an application needs. It gives local development tools and Docker builds a shared dependency checklist instead of relying on packages already installed on a server. section 3.2.3 section 4.4.1
A practical dependency workflow looks like this:
- Install the packages required by the project, such as FastAPI, Uvicorn, pytest, and httpx. section 4.4.1 section 4.3
- Generate the file with pip freeze > requirements.txt, or use an IDE that supports requirements-file management. section 4.4.1 section 4.3
- Review the generated entries and confirm that intended packages, including FastAPI and Uvicorn, are present; transitive dependencies may also appear. section 4.4.1
- Copy the file into a Docker image and run pip during the image build to install its packages. section 3.2.3
FastAPI container setup
After installing Uvicorn alongside FastAPI, generate requirements.txt and check that both packages appear. A Dockerfile can then copy the file into the image and run pip to install the declared dependencies before starting the API. section 3.2.3 section 4.4.1



