欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

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

发布时间:2024/4/14 linux 64 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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文件中添加或修改

[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


本文转自Tenderrain 51CTO博客,原文链接:http://blog.51cto.com/tenderrain/1956752,如需转载请自行联系原作者





总结

以上是生活随笔为你收集整理的mac 或linux上 pip 不支持ssl的问题的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。