MacTribe(如何优雅的使用Mac)

brew upgrade引发的ssl小问题

2020-03-12  本文已影响0人  OverLight

brew upgrade

今天手哆嗦了一下,brew upgrade打出去了,然后开始自动更新所有的包……

过了一会需要写代码了,打开pycharm
Referenced from: ~/.pyenv/versions/3.6.9/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
😳😳😳

以为缺少了ssl模块,就pip install ssl

Collecting ssl
  Could not fetch URL https://pypi.org/simple/ssl/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/ssl/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/ssl/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/ssl/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/ssl/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/ssl/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/ssl/
  Could not find a version that satisfies the requirement ssl (from versions: )
No matching distribution found for ssl
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

😳😳😳

自己是Mac,想了想,之前没啥事怎么突然电脑就出问题了呢,好像brew操作了?!


这期间各种谷歌、百度、搜索🔍


好像ssl都跟openssl相关,就搜索brew --prefix openssl

image.png

嗯😓啥时候多了个版本的


brew list.png

好吧,都是我的错🤪不该更新所有的软件(关键是我不知道呀🤪)

因为python是编译安装的,是基于上一次编译的系统环境编译的,那么这次我的python出问题就是因为系统环境出了点问题,所以我选择重新编译python
之前还测试了好几遍……


test.png

解决办法:

果然,用的是我brew upgrade之后的系统环境

后记

记得以后不要随随便便就更新所有的软件🙄(抽它抽它-手:招你惹你了……),影响其他软件的软件最好锁定了
brew pin openssl@1.1
需要更新的时候主动放开unpin

python2已经不更新了,除了系统自带python2,自己安装都是python3

上一篇下一篇

猜你喜欢

热点阅读