pipreqs

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 about 1 year ago
Repo Created over 3 years ago
Repo Last Updated 10 months ago
Size 204 KB
Organization / Authorbndr
Contributors12
Page Updated
Do you use pipreqs? Leave a review!
View open issues (31)
View pipreqs activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

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

Installation

::

pip install pipreqs

Usage

::

Usage:
    pipreqs [options] <path>

Options:
    --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="http://10.10.1.10:3128"
                          $ export HTTPS_PROXY="https://10.10.1.10:1080"
    --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.

Example

::

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

Contents of requirements.txt

::

wheel==0.23.0
Yarg==0.1.9
docopt==0.6.2

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 2 years Jupyter Notebooks support
  • over 2 years Creating Requirements txt for GAE Directory setup
  • over 2 years zope issue
  • almost 3 years Add an option to just print the output
  • almost 3 years Missed psycopg2
  • almost 3 years Dynamic module dependencies
  • about 3 years Use the version from local package if such package is installed
  • over 3 years Error while creating requirements.txt
  • over 3 years Proposal: input param for generate version between current and next major
  • over 3 years Clean up requirements.txt
  • over 1 year -bash: pipreqs: command not found
  • over 1 year Python 3.6 support?
  • almost 2 years PyCrytoDome is not being recognized
  • almost 2 years unwanted package
  • almost 2 years Recursive dependencies of imported libraries
  • about 2 years TabError and SyntaxError when running pipreqs in downloaded repos
  • about 2 years <package>/<package>.egg-info directories cause bad versions in requirements.txt
  • about 2 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