How to freeze a requirement with pipenv?

arshbot picture arshbot · Aug 14, 2018 · Viewed 20.4k times · Source

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"

Answer

Aratz Manterola Lasa picture Aratz Manterola Lasa · Jan 23, 2019

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

pipenv lock -r > requirements.txt