当前位置: 知识网 > 建站问题

django RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods

知识网2021年10月24日 00:07原创

出现错误:RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods是因为缺少cryptography包。

可以使用 pip install cryptography 安装cryptography包。

如果安装cryptography失败,先检查一下自己的pip包是否为最新版本,在settings>Project>Project Interpreter里查看pip的版本。

接下来使用easy_install -U pip 更新pip,或者通过提示的错误‘/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install --upgrade pip(此命令根据提示进行操作,可能跟这个不太一样,至少python版本是会变动的)’进行升级。

然后再用 pip install cryptography 安装cryptography包。

如果是在运行python3 manage.py makemigrations时,执行了上面的操作还提示此错误,那么请删除migrations下面的0001_initial.py,再次执行即可成功。

很赞哦!(8)

发表高见 (请对您的言行负责)

©芃睿知识网 版权所有 2012-2023 shsongjiang.com

备案号:赣ICP备2022001527号-1