

1.准备编译环境gcc
2.去官网下载要安装的对应版本的python的源代码
下载地址:https://www.python.org/downloads/source/
你可以选择你要下载的版本,用wget指令来下载相应的源代码
3.解压下载的代码包
tar -zxvf Python-x.x.x.tgz cd Python-x.x.x4.配置
1)查找configure文件
find . -name configure cd 搜索结果(一般就在Python文件根目录下)2)进行配置
./configure5.编译
make make install(如果没有其他特殊需求,安装就到此结束了,输入pythonx.x即可以进入你刚刚安装的python开发环境)
6.替换以前的python默认版本(创建新的软连接)
cd /usr/bin/ rm -rf python ln -s /usr/local/Python-x.x.x/bin/python ./python以上这篇Linux下安装或升级Python 2.7的操作方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持免费资源网。
© 版权声明
THE END
暂无评论内容