【发布时间】:2020-05-13 02:36:03
【问题描述】:
我在构建我的 docker 文件时遇到了类似的问题。就我而言,我正在尝试安装aiohttp==3.6.2 和Python 3.6.8。我的 docker 文件中列出了其他已成功安装的软件包。
Docker 文件中的命令来安装包。 (基本操作系统映像 - Ubuntu 18.04)RUN pip3 install aiohttp==3.6.2
补充一下,我可以使用pip install aiohttp==3.6.2在我的机器环境中成功安装
有人可以帮忙吗?
编辑 - 更多信息
Step 6/15 : RUN pip3 install aiohttp==3.6.2
---> Running in 9b36f2b7bd80
Collecting aiohttp==3.6.2
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /packages/7c/39/7eb5f98d24904e0f6d3edb505d4aa60e3ef83c0a58d6fe18244a51757247/aiohttp-3.6.2-cp36-cp36m-manylinux1_x86_64.whl
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /packages/7c/39/7eb5f98d24904e0f6d3edb505d4aa60e3ef83c0a58d6fe18244a51757247/aiohttp-3.6.2-cp36-cp36m-manylinux1_x86_64.whl
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /packages/7c/39/7eb5f98d24904e0f6d3edb505d4aa60e3ef83c0a58d6fe18244a51757247/aiohttp-3.6.2-cp36-cp36m-manylinux1_x86_64.whl
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /packages/7c/39/7eb5f98d24904e0f6d3edb505d4aa60e3ef83c0a58d6fe18244a51757247/aiohttp-3.6.2-cp36-cp36m-manylinux1_x86_64.whl
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /packages/7c/39/7eb5f98d24904e0f6d3edb505d4aa60e3ef83c0a58d6fe18244a51757247/aiohttp-3.6.2-cp36-cp36m-manylinux1_x86_64.whl
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/7c/39/7eb5f98d24904e0f6d3edb505d4aa60e3ef83c0a58d6fe18244a51757247/aiohttp-3.6.2-cp36-cp36m-manylinux1_x86_64.whl (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))
我还尝试通过 bashing 到我正在运行的容器中手动安装该软件包。它抛出了同样的错误:
【问题讨论】:
-
我能够在基于
ubuntu:18.04的Dockerfile 中成功RUN pip3 install aiohttp==3.6.2。无论您的问题是什么,如果我们能够为您提供帮助,您都需要向我们提供更多信息。请更新您的问题以包含您的实际 Dockerfile 和您看到的具体错误消息。 -
感谢您的评论,我已经添加了日志。请注意。如果还有什么我需要发布的,请告诉。 @larsks
-
不是答案,但您应该在一个命令中使用
pip安装多个软件包:pip3 install numpy requests pandas .... -
在不同的行上安装让我可以看到究竟是哪个包有问题,就好像它是一行一样,它总是说它是第一个包,因为整个命令都失败了。
标签: python docker pip dockerfile