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

推荐订阅源

人人都是产品经理
人人都是产品经理
博客园_首页
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
美团技术团队
D
Docker
WordPress大学
WordPress大学
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
Y
Y Combinator Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

噜啦 - 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

赞赏作者

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