python2.7 升级到 python3.6

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-develxz-devel gcc
 mkdir /usr/download
cd  /usr/download
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
 tar -xvf Python-3.6.4.tgz
 mkdir /usr/local/python3
cd Python-3.6.4

 ./configure --prefix=/usr/local/python3
make
make  install
 ln -s /usr/local/python3/bin/python3 /usr/bin/python
mv /usr/bin/python /usr/bin/python_bak
 ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
[root@do1cloud03 ~]# python

2.参考:

https://www.jianshu.com/p/1cc8f77679c8

用一个例子来演示会更加清晰

Original: https://www.cnblogs.com/lixiuran/p/14128313.html
Author: 风与叶子
Title: python2.7 升级到 python3.6

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/10837/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部