貌似python2.7.15并没有直接支持linux的版本,需要下载源码编译安装
./configure --prefix=/usr/local/python2.7
make & make install
接着安装pip,首先报zlib问题,yum安装zlib*,同时需要修改源码Module/Setup
#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
去掉注释
重新make & make install
结果抱ssl错误。。。yum装openssl。。同时修改源码Module/Setup
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
去掉注释。
再次安装就成功了。。。。