惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
博客园_首页
美团技术团队
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
J
Java Code Geeks
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
雷峰网
雷峰网
爱范儿
爱范儿

噜啦 - centos

CentOS 手动升级/安装内核 - 噜啦 CentOS 手动升级/安装内核 - 噜啦 Centos 更换为163/阿里云源 - 噜啦 Centos 更换为163/阿里云源 - 噜啦 Centos6 安装Python2.7.6 - 噜啦 CentOS 6、7 一键更换内核安装锐速 - 噜啦 CentOS 6、7 一键更换内核安装锐速 - 噜啦 Centos 添加用户并授予root权限 - 噜啦 Centos 添加用户并授予root权限 - 噜啦
Centos6 安装Python2.7.6 - 噜啦
博主: 噜啦 · 2019-07-23 · via 噜啦 - centos

由于有经常需要在CentOS 6.X 上边安装Python 2.7.6的需求,这里写一下安装过程

查看原Python版本

[root@host ~]# python -V
Python 2.6.6

安装升级相应的软件包

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

下载python 2.7 的源码包

wget http://mirrors.sohu.com/python/2.7.6/Python-2.7.6.tgz

解压

tar zxf Python-2.7.6.tgz -C /usr/local/src/

安装

cd /usr/local/src/Python-2.7.6/
./configure --prefix=/usr/local/python2.7
make && make install

配置python

mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python

查看版本

[root@host Python-2.7.6]# python -V
Python 2.7.6

解决无法使用yum的问题

vi /usr/bin/yum

修改第一行的#!/usr/bin/python#!/usr/bin/python2.6

赞赏作者

如果觉得我的文章对你有用,请随意赞赏