使用pip更新模块遇到问题

首先 使用 requests包进行http请求的时候总是报错
Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'

分析是 pyOpenssl 模块的问题,pyOpenssl的版本太低了。于是更新pyOpenssl。
但是遇到问题:
Could not find a version that satisfies the requirement cryptography>=2.2.1 (from pyOpenSSL==18.0.0) (from versions: ) No matching distribution found for cryptography>=2.2.1 (from pyOpenSSL==18.0.0)
经查,发现requirements.txt 文件的问题
执行 pip freeze > requirements.txt
又遇到问题:
Cannot uninstall 'pyOpenSSL'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

经查是 maxOS的预装的six库的问题。(Apple这个six也真是666,导致很多bug,详见:https://github.com/pypa/pip/issues/3165

要执行 忽略six的命令,更新pyOpenssl
sudo -H pip install pyOpenSSL --upgrade --ignore-installed six
终于好了

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容