打开终端就出现如下错误,求帮助:
ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha512 ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha512
1
TimePPT PRO 卸了重装吧
另外,建议用 pyenv 直接管理 Python 版本吧,想咋折腾咋折腾 |
2
wangyzj 2020 年 3 月 26 日
哈哈
你犯了大忌了 |
3
misaka19000 2020 年 3 月 26 日
降低 openssl 的版本
|
4
Hanggi 2020 年 3 月 26 日
放弃 py 吧,真的是一坨浆糊,不想用。
|
5
oahebky 2020 年 3 月 26 日
重装警告
重装警告 重装警告 |
6
Ccbeango 2020 年 3 月 26 日
用 py 版本管理工具多好啊。
|
8
wangyzj 2020 年 3 月 26 日
环境变量改成 /Library/Frameworks/Python.framework/Versions 下面的试试
|
9
U7Q5tLAex2FI0o0g 2020 年 3 月 26 日
|
10
jiejiss 2020 年 3 月 26 日
brew install openssl
brew link openssl --force brew uninstall python brew install python --with-brewed-openssl |
11
abelzyp OP 我刚才照着这个帖子 https://www.jianshu.com/p/98383a7688a5 删除了 Python3.7 和 2.7,还是不行。求指教啊?
我现在 ls /Library/Frameworks/Python.framework/Versions 只有一个 Current,剩下啥都没了。 |
12
WoodenRobot 2020 年 3 月 26 日
[]( https://zhuanlan.zhihu.com/p/117457048) 试试这个,我之前遇到过
|
13
abelzyp OP @jiejiss 在执行 brew uninstall python 的时候,错误如下:
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.13 because it is required by macvim and vim, which are currently installed. You can override this and force removal with: brew uninstall --ignore-dependencies python 我是应该按照提示进行么? |
14
Cuo 2020 年 3 月 26 日
可以换用 pyenv 管理 python 版本,将 pyenv 下的 python 路径设为全局变量后就可以无视 brew 安装的 python 了。
|
16
U7Q5tLAex2FI0o0g 2020 年 3 月 26 日
我想问一下你一开始有 brew update 么
|
18
abelzyp OP @littleylv 执行 brew install python --with-brewed-openssl 的时候报错:Error: invalid option: --with-brewed-openssl,这块是命令不对么?我着实不太了解这块。
|
21
gitopen 2020 年 3 月 26 日
pyenv 最好用!
|
22
ivyliner 2020 年 3 月 26 日 via Android
conda 真香
|
23
wzwwzw 2020 年 3 月 26 日
Python 别升级啊,直接重装啊。
|
25
justin2018 2020 年 3 月 26 日
不要删除系统自带的
可以 brew install python3 安装好了后 python3 就是 3.xx 版本 python 是 2.xx 版本 |
26
abelzyp OP |
27
Livid MOD PRO |
28
misaka19000 2020 年 3 月 26 日
@abelzyp #25 因为我前几天遇到了和你一模一样的问题,后来在网上查找资料,最后就是通过给 openssl 降级解决的,从 1.1.1 降级到 1.0.2
|
29
abelzyp OP 现在看来,下面四条命令是最好用的:
brew install openssl brew link openssl --force brew uninstall python brew install python --with-brewed-openssl 但是我最后一条命令执行不成功,原因在上面我说了。 现在执行完成前三条命令后,我现在的报错信息已经是下面这个了,有人遇到过吗🤦♂️ /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh:99: /usr/local/bin/powerline-config: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh:102: /usr/local/bin/powerline-config: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory |
30
xingheng 2020 年 3 月 26 日
用 brew 安装 python 的你就是作死,死的透透的你就顿悟了。
|
32
Mark24 2020 年 4 月 8 日
brew 安装会编译,这是编译 Python 的时候,依赖有点问题。
卸掉,先装上编译 Python 需要的依赖,再安装 Python |