Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


pipreqs - Generate pip requirements.txt file based on imports of any project

Subscribe to updates I use pipreqs

Statistics on pipreqs

Number of watchers on Github 1454
Number of open issues 31
Average time to close an issue 14 days
Main language Python
Average time to merge a PR 7 days
Open pull requests 10+
Closed pull requests 4+
Last commit over 2 years ago
Repo Created about 5 years ago
Repo Last Updated about 2 years ago
Size 204 KB
Organization / Authorbndr
Page Updated
Do you use pipreqs? Leave a review!
View open issues (31)
View pipreqs activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating pipreqs for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


pipreqs - Generate requirements.txt file for any project based on imports

.. image:: https://img.shields.io/travis/bndr/pipreqs.svg :target: https://travis-ci.org/bndr/pipreqs

.. image:: https://img.shields.io/pypi/v/pipreqs.svg :target: https://pypi.python.org/pypi/pipreqs

.. image:: https://img.shields.io/coveralls/bndr/pipreqs.svg :target: https://coveralls.io/r/bndr/pipreqs

.. image:: https://img.shields.io/pypi/l/pipreqs.svg :target: https://pypi.python.org/pypi/pipreqs



pip install pipreqs



    pipreqs [options] <path>

    --use-local           Use ONLY local package info instead of querying PyPI
    --pypi-server <url>   Use custom PyPi server
    --proxy <url>         Use Proxy, parameter will be passed to requests library. You can also just set the
                          environments parameter in your terminal:
                          $ export HTTP_PROXY=""
                          $ export HTTPS_PROXY=""
    --debug               Print debug information
    --ignore <dirs>...    Ignore extra directories
    --encoding <charset>  Use encoding parameter for file open
    --savepath <file>     Save the list of requirements in the given file
    --print               Output the list of requirements in the standard output
    --force               Overwrite existing requirements.txt
    --diff <file>         Compare modules in requirements.txt to project imports.
    --clean <file>        Clean up requirements.txt by removing modules that are not imported in project.



$ pipreqs /home/project/location
Successfully saved requirements file in /home/project/location/requirements.txt

Contents of requirements.txt



Why not pip freeze?

  • pip freeze only saves the packages that are installed with pip install in your environment.
  • pip freeze saves all packages in the environment including those that you don't use in your current project. (if you don't have virtualenv)
  • and sometimes you just need to create requirements.txt for a new project without installing modules.
pipreqs open issues Ask a question     (View All Issues)
  • over 3 years Jupyter Notebooks support
  • over 3 years Creating Requirements txt for GAE Directory setup
  • almost 4 years zope issue
  • about 4 years Add an option to just print the output
  • over 4 years Missed psycopg2
  • over 4 years Dynamic module dependencies
  • over 4 years Use the version from local package if such package is installed
  • almost 5 years Error while creating requirements.txt
  • almost 5 years Proposal: input param for generate version between current and next major
  • about 5 years Clean up requirements.txt
  • about 3 years -bash: pipreqs: command not found
  • about 3 years Python 3.6 support?
  • about 3 years PyCrytoDome is not being recognized
  • about 3 years unwanted package
  • over 3 years Recursive dependencies of imported libraries
  • over 3 years TabError and SyntaxError when running pipreqs in downloaded repos
  • over 3 years <package>/<package>.egg-info directories cause bad versions in requirements.txt
  • over 3 years ERROR on creating requirements.txt - Probably problems with Meta classes
pipreqs open pull requests (View All Pulls)
  • Explicitly support Python 3.5
  • Add --print to README
  • Declare support for Python 3.6
  • bugfix: f.close() only required if open succeeded
  • add --ignore-cert-errors options
  • added support for >= in addition to ==
  • Implement `--no-pin` option.
  • Ordering imports by name
  • Add option to include imports from extensionless python files
  • Fix oauth and sort bugs
pipreqs list of languages used
Other projects in Python