【问题标题】:Docker: no such option: --use-wheelDocker:没有这样的选项:--use-wheel
【发布时间】:2018-09-24 22:13:22
【问题描述】:

我正在尝试使用 Docker 使用 this 存储库为 AWS Lambda 创建依赖包,但每当我尝试运行 build.sh 文件时,我都会收到以下消息:

没有这样的选项:--use-wheel

然后,当我尝试使用 pip install wheel(在 Docker 之外)时,我被告知它已经在我的本地机器上,它就是这样。 如何在 Docker 容器中安装 Wheel?

如果有帮助,这似乎是 build.sh 中给出问题的代码行:

test -f /outputs/requirements.txt && pip install --use-wheel -r /outputs/requirements.txt

非常感谢任何帮助!

【问题讨论】:

    标签: python docker pip dockerfile python-wheel


    【解决方案1】:

    您的问题不是由于缺少依赖项(wheel 安装在您引用的 build.sh 脚本中:https://github.com/ryansb/sklearn-build-lambda/blob/master/build.sh#L18

    use-wheel 已被弃用,pip 不再存在。

    您可以通过从脚本中省略 --use-wheel 条目来实现相同的目的。查看链接存储库上的 Python 3.6 PR:https://github.com/ryansb/sklearn-build-lambda/pull/16/files#diff-0b83f9dedf40d7356e5ca147a077acb4

    【讨论】:

    • 好的,我尝试用您链接到的拉取请求替换原始 build.sh,但现在我收到错误 pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application 并且我不确定如何在 Docker 中更新 pip,假设这就是我需要做的?我也会尝试省略原始 build.sh 中的命令,看看是否有帮助。
    • 它正在工作。按照您的建议,我只是删除了“--use-wheel”的所有实例。谢谢!
    【解决方案2】:

    --use-wheeldeprecated since pip 7(支持--only-binary)和removed since pip 10 beta 1

    修复 git repo 中的所有脚本:

    git grep -l -- --use-wheel | while read f; do sed -i -e 's|use-wheel|only-binary=:all:|g' ${f}; done

    【讨论】:

      猜你喜欢
      • 2020-12-20
      • 2016-01-17
      • 1970-01-01
      • 2016-09-24
      • 2020-08-18
      • 2016-10-06
      • 2017-02-08
      • 2021-12-12
      • 1970-01-01
      相关资源
      最近更新 更多