1. 程式人生 > >mac 或linux上 pip 不支持ssl的問題

mac 或linux上 pip 不支持ssl的問題

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文件中添加或修改

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/  #可以手工指定是http的或者https的 

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

如果是連接pypi.python.org的話配置如下

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


阿裏雲的速度要遠遠高於python官方的速度


另外可以安裝一下pyopenssl試試

pip install pyopenssl


另一篇文章

mac上安裝python3 和 sqlite的問題

mac 或linux上 pip 不支持ssl的問題