centos6 安装 python3.5.2

安装python3:

wget http://mirrors.sohu.com/python/3.5.2/Python-3.5.2.tar.xz

tar -xf Python-3.5.2.tar.xz

cd Python-3.5.2

./configure --enable-shared --enable-loadable-sqlite-extensions --with-zlib

make && make install

echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc

或者可以直接替换python2

rm /usr/bin/python

ln -sv /usr/local/bin/python3.5 /usr/bin/python

vim /usr/bin/yum

通过vim修改yum的配置

#!/usr/bin/python改为#!/usr/bin/python2.6,保存退出。

完成了python3的安装。```

 

 

python3.5安装报错

 

python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

将其复制到响应目录OK

cp libpython3.5m.so.1.0 /usr/lib/

cp libpython3.5m.so.1.0 /usr/lib64/

 

posted @ 2018-06-25 11:19  不经一番寒彻骨  阅读(113)  评论(0编辑  收藏  举报