Pip is configured with locations that require tls/ssl

env: centos7   python3.6.7 (机器为国外的vps,并且安装过openssl)

不知道是我的机器的原因还是什么,网上找的各种方法都不管用,都说加上--with-openssl参数编译,但我实测并不管用,这个参数被忽略掉了,怀疑很多人的博客都是在互相抄作业

 

[root@centos1 Python-3.6.7]# pip3 install django==1.11.9
pip is configured with locations that require TLS/SSL, however the ssl module i                                                n Python is not available.
Collecting django==1.11.9
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)                                                ) after connection broken by 'SSLError("Can't connect to HTTPS URL because the                                                 SSL module is not available.",)': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)                                                ) after connection broken by 'SSLError("Can't connect to HTTPS URL because the                                                 SSL module is not available.",)': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)                                                ) after connection broken by 'SSLError("Can't connect to HTTPS URL because the                                                 SSL module is not available.",)': /simple/django/

网上查找的方法都说是在编译python时加上--with-ssl 或者--with-openssl参数,

但查看了./configure 的参数列表并没有这和项,所以实际中编译时这个参数被忽略,

目前找到的一个可以解决的办法是更换pip源

mkdir ~/.pip
cd .pip
vim pip.conf
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

再用pip3 安装就正常了(这里不保证其他人的也管用)。

另外这里安装包时提示需要ssl,怀疑可能是国外vps,pip3源的影响

 

上一篇:Linux /etc目录,及系统服务

下一篇:Django restframework 初识