pipenv No such option: –requirements in latest version

Question:

command: pipenv lock --requirements --keep-outdated

output:

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

Error: No such option: --requirements Did you mean --quiet?

Any idea how to fix this?

Asked By: DilLip_Chowdary

||

Answers:

the -r option on pipenv lock command is deprecated for some time. use the requirements option to generate the requirements.txt

ie:

pipenv requirements > requirements.txt (Default dependencies)

and to freeze dev dependencies as well use the --dev option

pipenv requirements --dev > dev-requirements.txt

Sometimes, you would want to generate a requirements file based on your current environment, for example to include tooling that only supports requirements.txt. You can convert a Pipfile and Pipfile.lock into a requirements.txt file very easily.

see also: https://pipenv.pypa.io/en/latest/advanced/#generating-a-requirements-txt

Answered By: Shobi