How to create a requirements.txt?

Question:

I’m wondering how I can create a suitable requirements.txt for my Python 3 application?

Asked By: Daniel Santos

||

Answers:

type following line in your command prompt

pip freeze > requirements.txt
Answered By: Pawan

if you aren’t in virtualenv and don’t feel like putting all your installed packages in the requirements file like the accepted answer. just use pigar

Answered By: 0xMH

There’s a module called pipreqs which is designed for creating the requirements file.

pip install pipreqs
pipreqs /GitHub/FolderName #Insert path to file

Add the location to the folder where the python files reside. Pipreqs will create a requirements.txt file in the folder.

Answered By: siddhantsomani
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.