gpt4 book ai didi

Python 2.7 不再工作 : cannot import name md5

转载 作者:太空狗 更新时间:2023-10-29 18:09:16 25 4
gpt4 key购买 nike

我昨天在我的服务器(ubuntu 14.04)上安装了 python 3.6.3,现在我无法运行 python 2.7(在虚拟环境和“主环境”中)。

我一直在谷歌上寻找这个,但没有成功。

我尝试重新安装 openssl,因为我是红色的。

谁能帮帮我?我要疯了。

---> 这是我尝试执行 python 脚本(或 pip)时的消息:

*ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/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/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/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/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/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/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructoremphasized text
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/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/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/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
File "/var/www/QuantEngine/prod/QuantScripts/QuantEngineCli.py", line 11, in <module>
from services import DataStructureManager, DatabaseFsHelper, Orchestra, BacktestManager
File "/var/www/QuantEngine/prod/QuantScripts/services/__init__.py", line 8, in <module>
from BuySellManager import BuySellManager
File "/var/www/QuantEngine/prod/QuantScripts/services/BuySellManager.py", line 1, in <module>
import requests
File "/var/www/QuantEngine/venv/lib/python2.7/site- packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/var/www/QuantEngine/venv/lib/python2.7/site- packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/var/www/QuantEngine/venv/lib/python2.7/site- packages/urllib3/connectionpool.py", line 29, in <module>
from .connection import (
File "/var/www/QuantEngine/venv/lib/python2.7/site-packages/urllib3/connection.py", line 39, in <module>
from .util.ssl_ import (
File "/var/www/QuantEngine/venv/lib/python2.7/site- packages/urllib3/util/__init__.py", line 6, in <module>
from .ssl_ import (
File "/var/www/QuantEngine/venv/lib/python2.7/site- packages/urllib3/util/ssl_.py", line 7, in <module>
from hashlib import md5, sha1, sha256
ImportError: cannot import name md5*

最佳答案

我在 macOS 上遇到了同样的问题。

brew reinstall python@2 解决了这个问题。

也许您可以尝试重新安装 python。

关于Python 2.7 不再工作 : cannot import name md5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47884422/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com