How to automatically generate requirements.txt 📃 for your Python project.

There are 2 easy ways of doing this:

Method 1: pip environment

pip3 freeze > requirements.txt

Method 2: For individual projects

$ sudo pip install pigar
# Generate requirements.txt for current directory.
$ pigar

# Generating requirements.txt for given directory in given file.
$ pigar -p ../dev-requirements.txt -P ../



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ashwin A Raikar

Ashwin A Raikar

Artificial Intelligence Developer, Computer Vision Engineer, Software Developer at SandLogic and an avid gamer.