Your ICT partner

How to create a requirements.txt file of your python project?

How to create a requirements.txt file of your python project?

To get all installed modules or packages is by going to your virtual environment directory on the terminal and run the command:

pip3 freeze > requirements.txt

Another method, is by installing pipreqs package, e.g. pip3 install pipreqs

Then, it is as easy as:

cd $HOME/project/to/your/python/project
pipreqs .

As a result a requirements.txt file will be created in your python project directory.


« What process is behind a network port?

Comments

comments powered by Disqus