mac 或linux上 pip 不支持ssl的问题

mac 或linux上 pip 不支持ssl的问题

报错:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.


新版的pip 默认要求使用https源了,


pip 的源可以使用国内的源,下载速度会很快。


参考这个  http://mirrors.aliyun.com/help/pypi


pip.conf中要有trusted-host,就可以不用https了。同时也可以解决你的问题。


在~/.pip/pip.conf文件中添加或修改


如果你找不到 pip.conf 

可以通过 

 pip config list -v 查看 global 配置文件位置,如果没有,可以自己手动按路径创建即可。

我的Mac就没有,下面是我创建的

/Users/product/Library/Application Support/pip/pip.conf,文件如下

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com