centos系统升级python 2.7.3
作者:hebedich 时间:2023-08-18 06:40:52
首先下载源tar包
可利用linux自带下载工具wget下载,如下所示:
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
下载完成后到下载目录下,解压
tar -zxvf Python-2.7.3.tgz
进入解压缩后的文件夹
cd Python-2.7.3
在编译前先在/usr/local建一个文件夹python27(作为python的安装路径,以免覆盖老的版本)
mkdir /usr/local/python2.7.3
在解压缩后的目录下编译安装
./configure --prefix=/usr/local/python2.7.3
make
make install
此时没有覆盖老版本,再将原来/usr/bin/python链接改为别的名字
mv /usr/bin/python /usr/bin/python_old
再建立新版本python的链接
ln -s /usr/local/python2.7.3/bin/python2.7 /usr/bin/python
这个时候输入
python
就会显示出python的新版本信息
Python 2.7.3 (default, Sep 29 2013, 11:05:02)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
标签:centos,python
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python找出最小的K个数实例代码
2022-09-13 12:21:10
Python使用re模块实现信息筛选的方法
2021-10-10 09:34:46
深入浅出Golang中的sync.Pool
2024-02-11 12:59:34
![](https://img.aspxhome.com/file/2023/8/112208_0s.png)
Python实现UDP与TCP通信的示例详解
2023-04-07 07:01:05
uniapp封装小程序雷达图组件的完整代码
2024-04-17 09:55:26
![](https://img.aspxhome.com/file/2023/4/136464_0s.png)
Mysql事务中Update是否会锁表?
2024-01-14 19:11:33
详解Git.gitignore开发必备建议收藏
2022-04-29 13:44:13
PHP webshell检查工具 python实现代码
2024-05-03 15:06:00
用SQL统计SQLServe表存储空间大小的代码
2012-06-06 19:52:22
全网最细 Python 格式化输出用法讲解(推荐)
2021-07-15 12:01:32
![](https://img.aspxhome.com/file/2023/0/71300_0s.png)
浅谈解除装饰器作用(python3新增)
2022-05-30 03:31:52
python爬虫 正则表达式解析
2022-07-16 18:24:01
利用Python绘制数据的瀑布图的教程
2023-03-09 02:33:42
![](https://img.aspxhome.com/file/2023/3/102963_0s.jpg)
mysql 5.6.26 winx64安装配置图文教程(一)
2024-01-14 21:44:59
python OpenCV学习笔记直方图反向投影的实现
2021-01-12 09:16:44
![](https://img.aspxhome.com/file/2023/0/120940_0s.jpg)
Python 2种方法求某个范围内的所有素数(质数)
2022-09-07 08:43:40
![](https://img.aspxhome.com/file/2023/0/117990_0s.jpg)
golang语言实现的文件上传与文件下载功能示例
2023-06-19 00:05:31
mysql中like % %模糊查询的实现
2024-01-21 21:24:06
Python虚拟环境的创建和包下载过程分析
2023-01-02 12:46:10
![](https://img.aspxhome.com/file/2023/5/131245_0s.jpg)
DOM和XMLHttpRequest对象的属性和方法整理
2024-04-23 09:05:27