You can add dependencies to your Pipfile by editing it directly or using pipenv commands. For example, to add requests as a dependency:
If you are working on a team, deploying to production, or maintaining an application for more than a month, moving beyond requirements.txt is a necessity. The Pipfile (or its modern equivalent in pyproject.toml ) is the tool for that job. Pipfile
| Feature | requirements.txt | Pipfile + Pipenv | | :--- | :--- | :--- | | | Plain text, list of names/versions | Structured TOML | | Dev vs. Prod | Manual separate files ( -r base.txt ) | Native [dev-packages] section | | Environment manager | Relies on venv or virtualenv (manual) | Built-in pipenv shell (auto virtualenv) | | Deterministic builds | Requires pip freeze > requirements.txt (no hashes) | Automatic Pipfile.lock with hashes | | Source management | Unsupported (relies on --index-url flags) | Native [[source]] section | | Python version | Not recorded | Recorded in [requires] | You can add dependencies to your Pipfile by
To add a dependency to your project, use the pipfile add command. For example, to add the requests library, run: | Feature | requirements
Plus an autogenerated Pipfile.lock with full integrity hashes.
[requires] python_version = "3.10"