pythonpipenvpipfile

How to freeze a requirement with pipenv?


For example we have some pipfile (below) and I'd like to freeze the django version. We don't have a requirements.txt and we only use pipenv. How can I freeze the django version?

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "*"

[dev-packages]
black = "*"

[requires]
python_version = "3.6"

Solution

  • Pipenv do natively implement freezing requirements.txt. It is as simple as:

    pipenv lock -r > requirements.txt