Why does 'pipenv lock -r' errors with 'No such option: -r'?

Question:

With this minimal Dockerfile

FROM public.ecr.aws/lambda/python:3.8

RUN pipenv lock -r > requirements.txt

The pipenv command fails with the error message:

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

Error: No such option: -r

And, so, the docker build fails with

The command ‘/bin/sh -c pipenv lock -r > requirements.txt’ returned a non-zero code: 2

My pipenv is in version 2023.2.4.

pipenv lock -h doesn’t show the option -r exists and I can’t find anything online for this. Is the option deprecated? Is it changed?

Asked By: 5kobrat

||

Answers:

You are correct, this command does not work anymore

pipenv lock -r > requirements.txt

The recommended replacement is

pipenv requirements > requirements.txt

As pointed in the issue 5253 from there issue tracker.

Answered By: β.εηοιτ.βε
Categories: questions 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.