使用pip更新模塊遇到問題

首先 使用 requests包進(jìn)行http請(qǐng)求的時(shí)候總是報(bào)錯(cuò)
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)
經(jīng)查,發(fā)現(xiàn)requirements.txt 文件的問題
執(zhí)行 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.

經(jīng)查是 maxOS的預(yù)裝的six庫(kù)的問題。(Apple這個(gè)six也真是666,導(dǎo)致很多bug,詳見:https://github.com/pypa/pip/issues/3165

要執(zhí)行 忽略six的命令,更新pyOpenssl
sudo -H pip install pyOpenSSL --upgrade --ignore-installed six
終于好了

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容