安装Python3.6.x

#安装依赖包
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel -y

#下载Python3.6.x
wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7rc2.tgz
cd Python-3.6.7rc2
./configure --prefix=/usr/local/python3
make && make install

#编译成功
Looking in links: /tmp/tmpcaynq9x3
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-10.0.1 setuptools-39.0.1

#修改源
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python3/bin/python3 /usr/bin/python
cp /usr/bin/yum /usr/bin/yum.backup_2018-11-10
vi /usr/bin/yum
#!/usr/bin/python 修改为:#!/usr/bin/python2.6

升级pip到最新版本:
pip install --upgrade pip

  

posted @ 2018-11-19 16:07  努力哥  阅读(1364)  评论(0编辑  收藏  举报