今天重新安装了CentOS6.4,在搭建Python Django环境时,安装pip出现如下问题:
ImportError: cannot import name HTTPSHandle
这是因为没有安装相应的支持模块,于是yum安装openssl:
yum install openssl openssl-devel
重新编译安装Python2.7后,让我困惑的是问题依旧,通过搜索后发现,需要SSL编译支持是需要手动打开的:
打开Models/Setup.dist,找到如下行并注意取消注释:
# 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
再次编译安装后问题解决。