【问题标题】:Getting error while building docker image构建 docker 镜像时出错
【发布时间】:2020-02-29 11:37:38
【问题描述】:

我的 Docker 文件是

FROM python:3
ADD myapp.py /
RUN pip3 install tensorflow-gpu
RUN pip3 install numpy
RUN pip3 install pandas
CMD ["python3", "./myapp.py]

当我使用构建 docker 映像时 docker build -t gaurav . 我收到以下错误

Step 4/5 : RUN  pip3 install tensorflow-gpu
 ---> Running in 8f938c75e2e0
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7cd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d79d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7220>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7640>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7790>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu (from versions: none)
ERROR: No matching distribution found for tensorflow-gpu
The command '/bin/sh -c pip3 install tensorflow-gpu' returned a non-zero code: 1

你能帮我吗,我想安装所有这些包,但我无法克服这些错误。

【问题讨论】:

  • 我尝试改变安装顺序,比如先安装numpy,而不是tensorflow-gpu。我仍然得到同样的错误

标签: python docker tensorflow dockerfile


【解决方案1】:

https://github.com/tensorflow/tensorflow/issues/33374 - tensorflow 不适用于 python3.8,因此您必须使用 3.7 或更低版本的 python 图像:

FROM python:3.7

【讨论】:

    【解决方案2】:

    如此处所述Tensorflow - requirements

    Tensorflow 仅支持 Python 3.5–3.7

    【讨论】:

      猜你喜欢
      • 2020-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-15
      • 2022-01-02
      相关资源
      最近更新 更多