美文网首页
CentOS7 如何安装python3.8

CentOS7 如何安装python3.8

作者: 楍跑的鸟 | 来源:发表于2021-02-25 09:54 被阅读0次

工作需要使用Python3.8以上版本。因此需要卸载系统之前其他版本的 Python。以下就是我卸载其他版本,安装 Python3.8 版本步骤。

  • 一、卸载Python3.6
// 查看版本 
[root@localhost ~]#python -v
image.png
// 查找 Python 文件所在路径
[root@localhost ~]# whereis python
// 卸载删除 Python
[root@localhost ~]# rpm -qa|grep python3*|xargs rpm -ev --allmatches --nodeps
image.png
// 检测是否卸载删除干净
[root@localhost ~]# python
image.png
// 解压缩
[root@localhost ~]# tar -xvf Python-3.8.7.tgz
image.png
// 执行安装
// 运行脚本configure
[root@localhost ~]# cd Python-3.8.7
 
[root@localhost Python-3.8.7]# ./configure --prefix=/usr/local/python3

// make编译&make install安装
[root@localhost Python-3.8.7]#  make && make altinstall

// 运行make clean

// 删除一些临时文件 
[root@localhost Python-3.8.7]#  make clean

// 创建软链接
// ln -s -f 强制创建软连接
[root@localhost local] ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
 
[root@localhost local] ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
image.png
// 检测安装是否成功
[root@localhost ~]# python3 -V
image.png

相关文章

网友评论

      本文标题:CentOS7 如何安装python3.8

      本文链接:https://www.haomeiwen.com/subject/lueszktx.html