更改
创建页面,内容为“{{4}} 服务器系统:CentOS Linux release 7.3.1611 下载安装包:wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz 解压文件 tar -xzf Python...”
{{4}}
服务器系统:CentOS Linux release 7.3.1611
下载安装包:wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
解压文件
tar -xzf Python-3.5.2.tgz
进入目录
cd Python-3.5.2
编译安装
./configure --prefix=/usr/local/python3.5 --with-threads --enable-shared
make && make altinstall
备份旧python相关命令
mv /usr/bin/pip /usr/bin/pip_old
mv /usr/bin/easy_install /usr/bin/easy_install_old
mv /usr/bin/python /usr/bin/python_old
新版本python命令做软连接,快捷使用
ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib
ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib
ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib64
ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib64
ln -s /usr/local/python3.5/bin/python3.5 /usr/bin/python
ln -s /usr/local/python3.5/bin/easy_install-3.5 /usr/bin/easy_install
ln -s /usr/local/python3.5/bin/pip3.5 /usr/bin/pip
重新加载配置
/sbin/ldconfig -v
尽情使用吧~~!
参考:[https://segmentfault.com/a/1190000014598244?utm_source=index-hottest]
服务器系统:CentOS Linux release 7.3.1611
下载安装包:wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
解压文件
tar -xzf Python-3.5.2.tgz
进入目录
cd Python-3.5.2
编译安装
./configure --prefix=/usr/local/python3.5 --with-threads --enable-shared
make && make altinstall
备份旧python相关命令
mv /usr/bin/pip /usr/bin/pip_old
mv /usr/bin/easy_install /usr/bin/easy_install_old
mv /usr/bin/python /usr/bin/python_old
新版本python命令做软连接,快捷使用
ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib
ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib
ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib64
ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib64
ln -s /usr/local/python3.5/bin/python3.5 /usr/bin/python
ln -s /usr/local/python3.5/bin/easy_install-3.5 /usr/bin/easy_install
ln -s /usr/local/python3.5/bin/pip3.5 /usr/bin/pip
重新加载配置
/sbin/ldconfig -v
尽情使用吧~~!
参考:[https://segmentfault.com/a/1190000014598244?utm_source=index-hottest]