1.安装development组建和一些额外lib
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2.shared library 配置
打开/etc/ld.so.conf 添加路径 /usr/local/lib
更新配置 运行 /sbin/ldconfig
3.从官网获取Python2.7
wget http://python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz
这里的python版本可以自己更改为当前最新版,想知道当前最新版自己去官网查看版本号
解压
tar xf Python-2.7.11.tar.xz
./configure--prefix=/usr/local--enable-unicode=ucs4--enable-sharedLDFLAGS="-Wl,-rpath /usr/local/lib"
运行配置
make && make altinstall
下载安装ez——setup
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
python2.7 ez_setup.py
然后使用刚安装的ez安装pip
easy_install pip
参考网址 http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/