无法从get-pip.py安装pip

时间:2016-12-18 03:56:58

标签: python pip install

我正在使用没有root权限的远程Linux系统。我想在本地安装python和pip。我已经设法安装python,但在pip上失败了。我使用的命令如下:

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user

下载成功,但在运行第二个命令时,收到错误消息:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pip
Could not fetch URL https://pypi.python.org/simple/pip/: 
There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip

我也试过

python get-pip.py

但错误是一样的。 我的命令出了什么问题? 谢谢大家的帮助!!!

1 个答案:

答案 0 :(得分:1)

在这种情况下,你会发现它也可以import ssl

解决方案是:

  1. 安装openssl,yum install openssl openssl-devel

  2. 配置源代码

  3. 然后打开Modules/Setup,并在部分

    之后取消评论
    #SSL=/usr/local/ssl
    #_ssl _ssl.c \
    #       -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
    #       -L$(SSL)/lib -lssl -lcrypto
    
  4. 来自源代码的
  5. make & make install python