Redhat依赖于Python的特定版本,yum才能正常工作。因此,推荐的python安装方式是alt安装。
可以找到非常好的教程here:
要运行的命令的简短摘要(来自上一个链接):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
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
现在安装pip:wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
python2.7 ez_setup.py
easy_install-2.7 pip
如果需要安装已编译的扩展(如scipy),则可能需要遵循所述的操作here(特定于scipy,但提供了有关如何继续的想法)