VPS 的 CentOS6 升级 Python 的方法
VPS 的 CentOS6 升级 Python 的方法
centos默认安装python2.6。由于python和centos关联紧密,所以不建议卸载,进行编译升级
1.新开的VPS务必系统更新
yum -y update
yum groupinstall -y development or; yum groupinstall -y 'development tools'
yum install -y zlib-dev zlib-devel openssl-devel sqlite-devel bzip2-devel xz-libs
2.升级python>=2.7
编译参看: https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.xz
xz -d Python-2.7.6.tar.xz
tar -xvf Python-2.7.6.tar
xz -d Python-3.3.3.tar.xz
tar -xvf Python-3.3.3.tar
# Enter the file directory:
cd Python-2.7.6
# Start the configuration (setting the installation directory)
# By default files are installed in /usr/local.
# You can modify the --prefix to modify it (e.g. for $HOME).
./configure --prefix=/usr/local
cd Python-3.3.3
./configure
为了不覆盖系统默认选项 - 替换系统正在使用的PYTHON- 我们使用 make altinstall.
# Let's build (compile) the source
# This procedure can take awhile (~a few minutes)
make
# After building everything:
make altinstall
Example for version 3.3.3:
make && make altinstall # <--- Two commands joint together
我们直接进行
make
make install
3.建立软连接
编译的软件安装于 /usr/local/bin/python2.7
所以需要替换原来的 /usr/bin/python
mv /usr/bin/python /usr/bin/python2.6
rm /usr/bin/python
ln -s /usr/local/bin/python2.7 /usr/bin/python
vim /usr/bin/yum
/usr/bin/python 改成 /usr/bin/python2.6
4.更新 pip
https://bootstrap.pypa.io/get-pip.py
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
ln -s /usr/local/bin/pip /usr/bin/pip
如果wget下载不了这文件,可能是DNS解析问题,需要下载个文件
vi /etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
VPS 的 CentOS6 升级 Python 的方法的更多相关文章
- centos6升级python
CentOS 6中,默认安装了Python 2.6.而pip,jupyter这样的常用工具是不支持Python 2.6的.为了使用这些工具,就必须将Python 2.6升级到Python 2.7以上的 ...
- centos6升级python版本至python3.5
一. 从Python官网到获取Python3的包, 切换到目录/usr/local/src wget https://www.python.org/ftp/python/3.5.1/Python-3. ...
- CentOS升级Python的方法
centOS内核版本为:3.10.101-1.el6.elrepo.x86_64 1,下载Python安装包 wget http://www.python.org/ftp/python/2.7.6/P ...
- CentOS6 系统下升级python后yum命令使用时报错
CentOS6 系统下升级python后yum命令使用时报错,如下: [root@xxxxxxx]#yumFile"/usr/bin/yum",line30exceptKeyboa ...
- centos6.5升级python为2.7
今天线上服务器全部升级python环境为python-2.7.6的环境,我采用的方法是ansible+shell,代码如下,友提,Python-2.7.6.tgz.setuptools-14.3.1. ...
- 升级python导致yum报错的解决方法
把python从2.7升级到3.6后 , 使用yum报错 File ‘’/usr/bin/yum'', line 30 except KeyboardInterrupt, e: ^ 故障原因:yum采 ...
- 记一次centos6升级salt-minion启动失败的问题
记一次centos6升级salt-minion启动失败的问题 作者:耀耀 blog:https://www.liuyao.me 一.起因 升级Salt-minion后 使用/etc/init.d/sa ...
- Linux 下编译升级 Python
一.Centos下升级python3.4.3 1.下载安装 wget http://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz wget http ...
- 升级python到2.7版本pip不可用
升级python到2.7版本pip不可用 [root@localhost pip-7.1.2]# pip Traceback (most recent call last): File "/ ...
随机推荐
- Xamarin大佬的地址
https://www.cnblogs.com/hlx-blogs/p/7266098.html http://www.cnblogs.com/GuZhenYin/p/6971069.html
- POJ 1682 DP
原创: http://www.cnblogs.com/proverbs/archive/2012/10/03/2711151.html 超高仿: http://blog.csdn.net/mars_c ...
- HDU 5371 Hotaru's problem Manacher+尺取法
题意:给你一个序列,求最长的两段回文子串,要求他们共用中间的一半. 思路:利用Manacher求出p[i]表示的当前位置的最长回文串长度,然后把每一个长度大于等于2的回文串的左区间和右区间分别放到两个 ...
- Hadoop的单节点集群详细启动步骤
见,如下博客 hadoop-2.2.0.tar.gz的伪分布集群环境搭建(单节点) 很简单,不多赘述.
- hbase启动报错:Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
输入HBASE_MASTER_OPTS只是为了快速寻找这个选项而已,如果你手工找也可以 刚才那个命令回车后直接跳到这 前面加#就好了 修改后保存.重新启动hbase就好了. 注意:各个节点都要修改哦. ...
- SQL 小技能
1. SET STATISTICS TIMEON 附带原文 2.关于索引,是自己可以用Tsql语句建,也可以在设计表的时候选中某一个字段建立索引 一般而言,主键属于聚合索引(字典:A-Z);反 ...
- 《五》uploadify插件上传文件
下载地址:http://www.uploadify.com/wp-content/uploads/files/uploadify.zip 相关配置:http://www.uploadify.com/d ...
- 用Understand阅读 VS2010项目源码
一.查看vs2010项目 打开understand,File-New-Project...-Next-Next [向导第三步,选"Import Visual Sudio project fi ...
- OpenCASCADE 3 Planes Intersection
OpenCASCADE 3 Planes Intersection eryar@163.com Abstract. OpenCASCADE provides the algorithm to sear ...
- android启动模式对于体验的影响
说到Android的启动模式.懂Android的人肯定都懂. 通过设置启动模式我们不仅能够节省内存的使用.还能达到更好的体验,比方我们打开一个应用,点击home键回到主界面的时候程序是没有被kill掉 ...