例如 python 3.6 安装
./configure --prefix=/usr/local/python3 --enable-shared CFLAGS=-fPIC
make && make install
生成 (/usr/local/python3) libpython3.和libpython3..1.0
./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl
make && make install
生成 (/usr/local/python3) libpython3.
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
如果 python3 -V
报错 python3: error while loading shared libraries: libpython3..1.0: cannot open shared object file: No such file or directory
解决方案
cp /usr/local/python3/lib/libpython3..1.0 /usr/lib64/
卸载python3
rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps 卸载pyhton3
whereis python3 |xargs rm -frv 删除所有残余文件
成功卸载!
whereis python 查看现有安装的python