Is there any way to output requirements.txt automatically? Is there any way to output requirements.txt automatically? python-3.x python-3.x

Is there any way to output requirements.txt automatically?


Try the following command:

pip freeze > requirements.txt


Pigar works quite well I just tested it

https://github.com/damnever/pigar

The answer above with pip freeze will only work properly if you have set up a virtualenv before you started installing stuff with pip. Otherwise you will end up with requirements which are "surplus to requirements". It seems that pigar goes and looks at all your import statements and also looks up the versions currently being used. Anyway, if you have the virtualenv set up before you start it will all be cleaner, otherwise pigar can save you. It looks in subdirectories too.


open the terminal in Pycharm and type in this command:

pip freeze > requirements.txt

and the requirements.txt will be automatically created