首先 使用 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
終于好了