码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2017-08-16 15:18:53      阅读:189      评论:0      收藏:0      [点我收藏+]

标签: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的问题

标签:pip ssl

原文地址:http://tenderrain.blog.51cto.com/9202912/1956752

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!