点我进入原文
1. python 地址:https://www.python.org/ftp/python/2.7.9/
2. 背景:
我们申请了科大云主机, 默认配置了 centos 6.5 的环境, 但是其中的python 只是2.6.6 , 这里将他更新到 2.7.9
3. pip 安装 部分参考 :http://www.cnblogs.com/hengwei/p/5464678.html
4.python 安装 setuptools Compression requires the (missing) zlib module 的解决方案
只能安装依赖后, 重装python http://www.jb51.cc/article/p-xsouiaaq-mw.html
CentOS 6.X怎么更新Python2.7.x版本
听语音
- |
- 浏览:225
- 更新:2015-11-26 13:14
-
1
-
2
-
3
-
4
-
5
-
6
-
7
CentOS 6.X自带默认python版本为2.6.6。但由于工作需要,很多时候需要2.7版本,所以需要进行版本升级。
工具/原料
-
一台CentOS系统服务器
-
使用 python -V 查询本机python系统。
-
再安装新版之前安装 先安装bz2、zlib,执行下列代码进行安装
#yum install -y zlib-devel bzip2-devel xz-libs wget
采用wget下载python,执行:
# wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
,下载完后依次执行:
# xz -d Python-2.7.8.
# tar.xz tar -xvf Python-2.7.8.tar
进行解压
解压完后 ,进入刚解压的Python-2.7.8目录(注意区分大小写),如图:
进入目录后 依次执行:
# ./configure --prefix=/usr/local
# make altinstall
如图:
注意:如果执行make altinstall时出现:make: *** No targets specified and no makefile found. Stop. 之类错误,这是由于没有安装编译器所导致,执行:# yum install gcc gcc-c++ autoconf automake 安装即可解决!