Skip to main content

A CLI tool to convert Pipfile/Pipfile.lock to requirments.txt

Project description


CLI tool to convert Pipfile/Pipfile.lock to requirments.txt

Required Python version

>=2.7, >=3.4

What does it do?

The tool is built on top of requirementslib to provide a simple CLI to convert the Pipenv-managed files to requirements.txt.

Pipenv is a great tool for managing virtualenvs and dependencies, but it may be not that useful in deployment. Pip installation is much faster than Pipenv manipulation, since the latter needs extra requests to PyPI for hash checking. Installing a Pipenv in deployment may be overkilled. We just need a requirements.txt to tell CI or production server which packages and versions should be installed.


$ pip install pipfile-freeze

An executable named pipfile will be ready for use in the bin path.


Output requirements directly to the console:
$ pipfile freeze

Output requirements to the file, default './requirements.txt' with -o:
$ pipfile freeze -o
$ pipfile freeze -o /path/requirements.txt

Specify a project root path
$ pipfile freeze -p myproject

Complex example
$ pipfile freeze -p myproject --hashes -d -o /path/requirements.txt

If your Pipfile like this:

name = "tuna"
url = ""
verify_ssl = true

name = "pypi"
url = ""
verify_ssl = true


requests = "*"
ilogger = "==0.1"
apscheduler = "*"
pywinusb = {version = "1.1", sys_platform = "== 'win32'"}

python_version = "3.7"

Here is the output (requirements.txt):


pywinusb; sys_platform == 'win32'


$ pipfile freeze --help
usage: pipfile freeze [-h] [-p PROJECT] [--hashes] [-d] [-o [file]] [file]

positional arguments:
  file                  The file path to convert, support both Pipfile and
                        Pipfile.lock. If it isn't given, will try Pipfile.lock
                        first then Pipfile.

optional arguments:
  -h, --help            show this help message and exit
  -p PROJECT, --project PROJECT
                        Specify another project root
  --hashes              whether to include the hashes
  -d, --dev             whether to choose both develop and default packages
  -o [file], --outfile [file]
                        Output requirements to the file



This tool is improved based on the pipfile-requirements tool, thanks to @frostming for his contribution.

Project details

Download files

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

Files for pipfile-freeze, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size pipfile-freeze-0.1.3.tar.gz (14.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page