‘pipenv lock -r’ 出现 ‘No such option: -r’ 错误的原因是什么?

huangapple go评论84阅读模式
英文:

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

问题

使用这个极简的 Dockerfile

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

RUN pipenv lock -r > requirements.txt

pipenv 命令会出现以下错误消息:
> 用法:pipenv lock [选项]
> 尝试 'pipenv lock -h' 获取帮助。
>
> 错误:没有这个选项:-r

因此,Docker 构建会失败,错误信息如下:
> 命令 '/bin/sh -c pipenv lock -r > requirements.txt' 返回非零代码:2

我的 pipenv 版本是 2023.2.4。

pipenv lock -h 并没有显示 -r 选项存在,我在网上也找不到相关信息。这个选项是否已被弃用?它有变化吗?

英文:

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?

答案1

得分: 0

你说得对,这个命令不再起作用了

建议的替代命令是

pipenv requirements > requirements.txt

如在问题 5253中所指出的。

英文:

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.

huangapple
  • 本文由 发表于 2023年2月16日 19:06:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75471356.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定