WHY
We need to track the dependencies that are being used in the application. Its an way to keep track of the modules that are being used with versions.FORMAT
The requirement file will have the data in this formatrequests==1.1.9
Flask==0.9.0
METHODS
PIPREQS
URL:https://github.com/bndr/pipreqsInstallation:
pip install pipreqsExample:
pipreqs /home/project/locationContents of requirements.txt
wheel==0.23.0
Yarg==0.1.9
docopt==0.6.2
FREEZE
- It's good to use this when using virtual env for your project.
- It saves the packages that are installed with pip install in your environment
- It saves all packages in the environment including those that you don't use in your current project. (if you don't have virtualenv)
How to install dependencies from requirements.txt file
pip install -r <path_to_requirements.txt>
Keep Learning