特别注意: yum的镜像要切到阿里云,如果yum install/update一直调用/etc/yum.repos.d/docker-ce.repo,可以先改名, 再改回来。如下信息:
Trying other mirror.
docker-ce-stable/7/x86_64/prim FAILED
https://download.docker.com/linux/centos/7/x86_64/stable/repodata/aa1f3958af9cb5f1f6c34b5725f63de4f5e3e46c236205b598fecfec6ad506f6-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed to connect to 2a03:2880:f10c:83:face:b00c:0:25de: Network is unreachable"
1、查看当前的python是否安装 whereis python
2、安装依赖:yum groupinstall "Development tools" -y
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel -y
3、下载11到任意目录: wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz
信息如下:
/opt
[root@hcss-ecs-966b opt]# ls
ls
containerd data Python-3.11.0 Python-3.11.0.tgz
4、解压:tar xzf Python-3.11.0.tgz
5、cd Python-3.11.0 & ./configure --enable-optimizations
6、make altinstall
信息如下:
Installing collected packages: setuptools, pip
Successfully installed pip-22.3 setuptools-65.5.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
7、ln -s /usr/local/bin/python3.11 /usr/local/bin/python3
ln -s /usr/local/bin/pip3.11 /usr/local/bin/pip3
8、whereis python3
9、python3 --version
信息如下:
[root@hcss-ecs-966b Python-3.11.0]# python3 --version
Python 3.11.0
whereis pip3
pip3: /usr/bin/pip3.6 /usr/bin/pip3 /usr/local/bin/pip3.11 /usr/local/bin/pip3 /usr/local/bin/pip3.10 /usr/share/man/man1/pip3.1.gz
[root@hcss-ecs-966b opt]# pip3 -V
pip 22.3 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)
浙公网安备 33010602011771号