Docker Build在PIP升级时崩溃,但是错误消息说升级PIP

发布于 2025-01-25 09:48:47 字数 2153 浏览 1 评论 0原文

我正在尝试从以下(删节)docker文件构建图像:

FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
LABEL maintainer [email protected]


RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        cmake \
        git \
        wget \
        libatlas-base-dev \
        libboost-all-dev \
        libgflags-dev \
        libgoogle-glog-dev \
        libhdf5-serial-dev \
        libleveldb-dev \
        liblmdb-dev \
        libopencv-dev \
        libprotobuf-dev \
        libsnappy-dev \
        protobuf-compiler \
        python-dev \
        python-numpy \
        python-pip \
        python-setuptools \
        python-scipy && \
    rm -rf /var/lib/apt/lists/*


ENV CAFFE_ROOT=/opt/caffe
WORKDIR $CAFFE_ROOT

# FIXME: use ARG instead of ENV once DockerHub supports this
# https://github.com/docker/hub-feedback/issues/460
ENV CLONE_TAG=1.0

RUN git clone -b ${CLONE_TAG} --depth 1 https://github.com/BVLC/caffe.git . && \
    pip install --upgrade pip

但是,当我运行docker build时。 -t ='docker_t3',我收到以下错误:

Collecting pip
  Downloading https://files.pythonhosted.org/packages/33/c9/e2164122d365d8f823213a53970fa3005eb16218edcfc56ca24cb6deba2b/pip-22.0.4.tar.gz (2.1MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-YHY519/pip/setup.py", line 7
        def read(rel_path: str) -> str:
                         ^
SyntaxError: invalid syntax

   ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-YHY519/pip/
You are using pip version 8.1.1, however version 22.0.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

由于崩溃的命令为pip install -upgrade pip我不确定当错误时如何避免崩溃消息是您应该考虑通过“ PIP Install -upgrade pip”命令升级。

我该怎么办?

I'm trying to build an image from the following (abridged) Docker file:

FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
LABEL maintainer [email protected]


RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        cmake \
        git \
        wget \
        libatlas-base-dev \
        libboost-all-dev \
        libgflags-dev \
        libgoogle-glog-dev \
        libhdf5-serial-dev \
        libleveldb-dev \
        liblmdb-dev \
        libopencv-dev \
        libprotobuf-dev \
        libsnappy-dev \
        protobuf-compiler \
        python-dev \
        python-numpy \
        python-pip \
        python-setuptools \
        python-scipy && \
    rm -rf /var/lib/apt/lists/*


ENV CAFFE_ROOT=/opt/caffe
WORKDIR $CAFFE_ROOT

# FIXME: use ARG instead of ENV once DockerHub supports this
# https://github.com/docker/hub-feedback/issues/460
ENV CLONE_TAG=1.0

RUN git clone -b ${CLONE_TAG} --depth 1 https://github.com/BVLC/caffe.git . && \
    pip install --upgrade pip

However, when I run docker build . -t='docker_t3', I get the following error:

Collecting pip
  Downloading https://files.pythonhosted.org/packages/33/c9/e2164122d365d8f823213a53970fa3005eb16218edcfc56ca24cb6deba2b/pip-22.0.4.tar.gz (2.1MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-YHY519/pip/setup.py", line 7
        def read(rel_path: str) -> str:
                         ^
SyntaxError: invalid syntax

   ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-YHY519/pip/
You are using pip version 8.1.1, however version 22.0.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Since the command that crashed the build was pip install --upgrade pip I'm not certain how to avoid crashing when the error message is You should consider upgrading via the 'pip install --upgrade pip' command.

What should I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文