What It Is
A plain text file listing the libraries your project needs. Anyone can reproduce your environment with a single command.
Format
requests==2.31.0 numpy>=1.24,<2.0 flask
Commands
pip freeze > requirements.txt # capture current versions pip install -r requirements.txt # install from file
Version Specifiers
==exact version.>=,<bounds.- No operator โ latest available.
Tips
- Pin exact versions for reproducibility (
==). - Separate dev tools into
requirements-dev.txt. - Consider
pip-toolsorpoetryfor bigger projects.
Practise this on PyForm โ free
PyForm runs Python in your browser with an AI tutor trained for HKDSE. No install, no credit card.
Open PyForm โ