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的配置
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/