英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论