How to write requirements.txt in python project
if you are using pip freeze to generate requirements.txt , it will dump all the dependencies and sub dependencies in requirement.txt.
pip freeze > requirements.txt
creating the requirements.txt using the pipreqs.
Instaling the pipreqs
pip install pipreqs
for creating the requirements.txt
It scans all the imports in apps folder and create the optimised requirements.txt file in apps directory. Subdepedencies resolved internaly.
output for the above project is :
for more information: