linux下更新python版本
来源:互联网 发布:听力复读软件 编辑:程序博客网 时间:2024/06/06 06:57
首先下载源tar包
可利用linux自带下载工具wget下载,如下所示:
1
# wget http://www.python.org/
ftp
/python/3.3.0/Python-3.3.0.tgz
或自己去网上找,这里提供一个最新版的下载链接:http://xiazai.zol.com.cn/detail/33/320958.shtml
这里我用的是第二种方法,下载的是Python-3.1.2.tar.bz2版本,下载完成后到下载目录下,解压
1
bunzip2
Python-3.1.2.tar.bz2
2
tar-xvf Python-3.1.2.tar
(若是第一种方法,则直接解压缩tar -xzvf Python-3.3.0.tgz)
进入解压缩后的文件夹
1
cd
Python-3.1.2
在编译前先在/usr/local建一个文件夹python3(作为python的安装路径,以免覆盖老的版本)
1
mkdir
/usr/
local
/python3
开始编译安装
1
./configure --prefix=/usr/
local
/python3
2
make
3
make
install
此时没有覆盖老版本,再将原来/usr/bin/python链接改为别的名字
1
mv
/usr/bin/python /usr/bin/python_old
再建立新版本python的链接
1
ln
-s /usr/
local
/python3/bin/python3 /usr/bin/python
这个时候输入
1
python
就会显示出python的新版本信息
1
Python 3.1.2 (r312:79147, Oct 21 2012, 01:03:21))
2
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
3
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information.
4
>>>
PS:如果不建立新安装路径python3,而是直接默认安装,则安装后的新python应该会覆盖linux下自带的老版本,也有可能不覆盖,具体看安装过程了,这个大家可以自己试验下,当然如果还想保留原来的版本,那么这种方法最好不过了。
0 0
- 更新linux下python版本
- linux下更新python版本
- linux下更新python版本
- linux下更新Python版本并修改默认版本
- linux下更新Python版本并修改默认版本
- linux更新python版本
- linux python 更新版本
- Centos下更新Python版本
- Ubuntu下更新python版本
- linux下 更新 java版本
- Ubuntu下python版本更新问题
- centos下更新Python的版本
- centos下更新Python版本的步骤
- centos下更新Python版本的步骤
- SUSE linux下更新python
- Linux更新python版本(2.6---2.7)
- linux下Python版本升级
- linux 下升级python版本
- Redis过期键
- jQuery html5Validate基于HTML5表单验证插件
- Codeforces Round #277.5 (Div. 2)(C题)
- Codeforces Round #277.5 (Div. 2)
- 关于销售订单高级定价的一点疑惑
- linux下更新python版本
- Android学习之客户端的开发(练习)
- static函数与普通函数
- SIGKDD国际会议简介(未完待续)
- android public.xml 用法
- Evolution 使用QQ邮箱
- poj 2612 Mine Sweeper
- 【文档摘要】J2EE Persistence - Introduction to the Java Persistence API【Managing Entities】
- suspend-resume(4)