一定要先把直接的链接删除

RUN rm -rf /usr/local/bin/python3 && rm -rf /usr/bin/python3

建立新的链接新的才会生效

RUN ln -sf /usr/local/bin/python3.7 /usr/local/bin/python3 && ln -sf /usr/local/bin/python3.7 /usr/bin/python3 && ln -sf /usr/local/bin/pip3.7 /usr/local/bin/pip3 && ln -sf /usr/local/bin/pip3.7 /usr/bin/pip3

指定python3.7的软件安装python包,前面加python3.7 -m

python3.7 -m pip install xx

 && python3.7 -m pip install --upgrade setuptools \
    && python3.7 -m pip install --upgrade pip \
    && python3.7 -m pip install -r requirements.txt \
    && python3.7 -m pip install paddlepaddle_gpu-2.2.2.post101-cp37-cp37m-linux_x86_64.whl  \
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐