RuntimeError: ‘cryptography‘ package is required for sha256_password or caching_sha2_password auth m

执行 python manage.py runserver 时报错:

。。。。。。
  File "/Users/jason93/Desktop/PythonProject/django_drf/venv-djdrf/lib/python3.9/site-packages/pymysql/_auth.py", line 204, in sha2_rsa_encrypt
    raise RuntimeError("'cryptography' package is required for sha256_password or caching_sha2_password auth methods")
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods

说 cryptography 这个包需要安装,则打开终端用pip进行安装,但发现安装不上:

(venv-djdrf) jason93@92 djangodrf % pip install cryptography
ERROR: Could not find a version that satisfies the requirement cryptography
ERROR: No matching distribution found for cryptography
(venv-djdrf) jason93@92 djangodrf % 

然后打开setting在pip管理中下载
RuntimeError: ‘cryptography‘ package is required for sha256_password or caching_sha2_password auth m_第1张图片
提示安装成功后,再次运行项目就可以了。

你可能感兴趣的:(PYTHON,Django,Bug,python,pip)