python 2.7:错误:未找到哈希md5的根代码

python 2.7:错误:未找到哈希md5的根代码,python,django,python-2.7,Python,Django,Python 2.7,我已经通过自制在我的macbook(macOS Big Sur 11.2.3)上安装了python。是的,我知道,它已经过时了,但我需要它来做一些老项目 我用virtualenv来分离东西 当我尝试运行/manage.py runserver时,出现以下错误: ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/

我已经通过自制在我的macbook(macOS Big Sur 11.2.3)上安装了python。是的,我知道,它已经过时了,但我需要它来做一些老项目

我用virtualenv来分离东西

当我尝试运行
/manage.py runserver
时,出现以下错误:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_2/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/2.7.15_2/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 "/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 8, in <module>
    from django.contrib.auth.hashers import (
  File "/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/hashers.py", line 241, in <module>
    class PBKDF2PasswordHasher(BasePasswordHasher):
  File "/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/hashers.py", line 251, in PBKDF2PasswordHasher
    digest = hashlib.sha256
AttributeError: 'module' object has no attribute 'sha256'
错误:根:未找到哈希md5的代码。
回溯(最近一次呼叫最后一次):
文件“/usr/local/cillar”/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py”,第147行,在
globals()[\uuuuu func\u name]=\uuuu get\u散列(\uuuu func\u name)
文件“/usr/local/cillar”/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py”,第97行,在uu get_builtin_构造函数中
raise VALUERROR('不支持的哈希类型'+名称)
ValueError:不支持的哈希类型md5
错误:根:未找到哈希sha1的代码。
回溯(最近一次呼叫最后一次):
.
.
.
文件“/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/apps/config.py”,第202行,在导入模型中
self.models\u module=导入模块(models\u module\u name)
文件“/usr/local/cillar”/python@2/导入模块第37行,2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py
__导入(名称)
文件“/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/models.py”,第4行,在
从django.contrib.auth.base_user导入AbstractBaseUser、BaseUserManager
文件“/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/base_-user.py”,第8行,在
从django.contrib.auth.hasher导入(
文件“/Users/Roland/PythonEnvs/django-wko/lib/python2.7/site-packages/django/contrib/auth/hasher.py”,第241行,在
类PBKDF2PasswordHasher(BasePasswordHasher):
PBKDF2PasswordHasher中的文件“/Users/Roland/PythonEnvs/django wko/lib/python2.7/site packages/django/contrib/auth/hasher.py”,第251行
摘要=hashlib.sha256
AttributeError:“模块”对象没有属性“sha256”
也许这是hashlib或openssl的问题? 谢谢