Command to output a pipenv lockfile into the requirements.txt file?


If you’d like a requirements.txt output of the lockfile, run
$ pipenv lock -r. This will include all hashes, however
(which is great!). To get a requirements.txt without hashes, use
$ pipenv run pip freeze.

According to the above pipenv notice, if you’d like a requirements.txt output of the lockfile, you should run $ pipenv lock -r. However, the -r options does not exist:

$ pipenv lock -r
Usage: pipenv lock [OPTIONS]
Try 'pipenv lock -h' for help.
$ pipenv lock -h
Usage: pipenv lock [OPTIONS]

  Generates Pipfile.lock.

  --categories TEXT
  --dev-only             Emit development dependencies *only* (overrides
  -d, --dev              Generate both develop and default requirements  [env
                         var: PIPENV_DEV]
  --extra-pip-args TEXT
  --pre                  Allow pre-releases.
  --python TEXT          Specify which version of Python virtualenv should
  --clear                Clears caches (pipenv, pip).  [env var: PIPENV_CLEAR]
  -q, --quiet            Quiet mode.
  -v, --verbose          Verbose mode.
  --pypi-mirror TEXT     Specify a PyPI mirror.
  -h, --help             Show this message and exit.

May I know the command to get the requirements.txt output of the pipenv lockfile?

Asked By: Sun Bear


The website you have linked to is The official docs at says:

Generate requirements.txt output from lock file

$ pipenv requirements
Answered By: muru
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.