Linux下升级安装Python-3.6.9版本
1.操作系统信息
(1)cat /etc/redhat-releas
(2)Red Hat Enterprise Linux Server release 6.0 (Santiago)
2.安装开发工具包,尽量安装一组开发工具包,避免后面缺东西
yum groupinstall Additional Development
3.下载python3.6.9
(1)python3.6.9下载地址
wegt https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
如果下载出现ssl验证失败 在前面加--no-check-certificate 跳过证书验证
(2)直接从本地上传,最笨的方法直接从win把压缩包拉到xshell服务器
(3)切记放到自己认识的目录
4.解压
(1)cd /root
(2)tar -zxvf Python-3.6.9.tgz
5.进入python 目录编译
(1)cd /opt/Python-3.6.9
(2)创建python3.6目录 mkdir /usr/local/python3.6.9
(3)编译 ./configure --prefix=/usr/local/python3.6.9 只向这个目录简单明了,以后好删除
(4)安装 make &make install
6.将python 2替换并创建python+pip软连接
(1)mv /usr/bin/python /usr/bin/python26
(2)rm /usr/bin/python2
(3)ln -s /usr/bin/python26 /usr/bin/python2
(4)ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python3
(5)ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python
(6)mv /usr/bin/pip /usr/bin/pip26
(7)ln -s /usr/local/python3.6/bin/pip3 /usr/bin/pip
(8)ln -s /usr/local/python3.6/bin/pip3 /usr/bin/pip3
(9)如果pip提示不存在直接敲pip软连接就行
7验证
(1)
(2)
(3)
替换完成--------------------哈哈哈----------------------------