Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Manages pip requirements files for multiple environments, e.g. production and development

Project Description


|Build Status| |Coverage Status| |PyPI Version| |Supported Versions| |Downloads|

pipreq simplifies handling Python project requirements across multiple
environments. pip freeze > requirements.txt gets your project started,
but do you really want mock, coverage, etc. installed on your production
server? Maybe you want to upgrade all your test requirements, but not your
production requirements. If you've ever found yourself sifting through the
output of pip freeze trying to figure out what packages you've installed
but didn't yet add to one of your requirements files, then pipreq is the
tool for you.


- Inspect a list of packages and create or update a requirements rc file
- Generate a set of requirements files from an rc file
- Upgrade all specified packages to the latest versions
- Remove stray packages in virtualenv


You can get pipreq from PyPI with:


pip install pipreq

The development version can be installed with:


pip install -e git://

If you are developing locally, your version can be installed from the
working directory with:




pipreq uses an rc file to track requirements. You create a section for
each requirements file, and (if desired) select one section to be
shared. The default configuration is as follows:


# .requirementsrc
shared = common




This would result in the following requirements directory structure:



where development.txt and production.txt both include the line "-r

**Getting Started with pipreq**

1. (Optional) Create an empty .requirementsrc file with your desired
metadata and sections

2. Interactively populate .requirementsrc file from currently installed

pip freeze \| pipreq -c

3. Generate requirements files from .requirementsrc file:

pipreq -g

4. Create a top-level requirements.txt file that points to your
production requirements, e.g. "-r production.txt"

**Keeping requirements up to date with pipreq**

1. Interactively update .requirementsrc file from currently installed

pip freeze \| pipreq -c

2. Re-generate requirements files from .requirementsrc file:

pipreq -g

3. Upgrade all packages to latest available versions:

cat requirements/development.txt | pipreq -U

3. Remove stray packages in virtualenv:

cat requirements/*.txt | pipreq -x


Fork the project on github and git clone your fork, e.g.:


git clone<username>/pipreq.git

Create a virtualenv and install dependencies:


mkvirtualenv pipreq
pip install -r requirements/package.txt -r requirements/test.txt

Run tests and view coverage:


coverage run -m nose
coverage report

Check code style:



Install your local copy:



.. |Build Status| image::
.. |Coverage Status| image::
.. |PyPI Version| image::
.. |Supported Versions| image::
.. |Downloads| image::

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(8.2 kB) Copy SHA256 Hash SHA256
Source Feb 8, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting