gpt4 book ai didi

python - 安装 Python 3.6.5 但在 Docker 中获得 Python 3.6.6

转载 作者:太空宇宙 更新时间:2023-11-03 13:58:20 25 4
gpt4 key购买 nike

我尝试安装特定版本的 Python (3.6.5),它在几周前工作,今天当我重建图像时,它给出了 3.6.6。

有人遇到这个问题吗?

Ubuntu(主机)版本:Ubuntu 18.04.1 LTS

Docker 版本:18.06.1-ce,构建 e68fc7a

这是我的 Dockerfile

FROM ubuntu:18.04

# ENV Variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHON_VERSION="3.6.5"

# Install core packages
RUN apt-get update
RUN apt-get install -y build-essential checkinstall software-properties-common llvm cmake wget git nano nasm yasm zip unzip pkg-config \
libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev mysql-client default-libmysqlclient-dev

# Install Python 3.6.5
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz \
&& tar xvf Python-${PYTHON_VERSION}.tar.xz \
&& rm Python-${PYTHON_VERSION}.tar.xz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure \
&& make altinstall \
&& cd / \
&& rm -rf Python-${PYTHON_VERSION}

最佳答案

您的 apt-get 命令静默安装 Python 3.6.6,因为其中一个程序依赖于 python,请参阅日志:

The following NEW packages will be installed:                                                          
...
pkg-config powermgmt-base publicsuffix python-apt-common python3 python3-apt
python3-dbus python3-gi python3-minimal python3-software-properties
python3.6 python3.6-minimal readline-common shared-mime-info
...

Ubuntu 包中可能有从 Python 3.6.5 到 3.6.6 的更新,因为这可能是因为在特定的 Ubuntu 版本中允许补丁版本更新(您可以在运行 apt-get update 后在您的主机上检查apt-get upgrade 因为我可以在我的 Ubuntu 18.04 Python 升级上看到)

关于python - 安装 Python 3.6.5 但在 Docker 中获得 Python 3.6.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52532872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com