#下载路径,也可直接使用wget进行下载 https://www.python.org/ftp/python/ #python3.10需要openssl1.1.1版本,需要yum安装 yum -y install openssl* #解压下载的python文件,并进入解压目录 #编译安装,使用$?检查每一步是否报错 ./configure --prefix=/usr/;ocal/python3 make make install安装后更改系统python版本
1,将老版本文件备份
mv /usr/bin/python /usr/bin/python_bak
2,创建新版本软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python
3,查看最新版本
python -Vxz结尾的文件如何解压
yum -y install xz xz -d *tar..xz tar xf *.tar
或
tar xvf *.tar.xz升级后yum安装异常解决办法 报错:
File “/usr/bin/yum”, line 30
except KeyboardInterrupt, e:
^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
[root@localhost ~]# whereis python python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz修改yum配置文件
修改 /usr/bin/yum第一行#!/usr/bin/python为#!/usr/bin/python_2.7
[root@localhost ~]# vim /usr/bin/yum #!/usr/bin/python_2.7其他安装方法
https://blog.csdn.net/weixin_42678675/article/details/124033131



