python3连接mysql报错RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods

使用pymysql报错RuntimeError ‘cryptography‘ package is required for sha256_password or caching_sha2_passw

如果报错:

解决办法:
安装cryptography
pip3 install cryptography

如果安装失败出现:

更新一下pip3就行:
pip3 install --upgrade pip

再重新安装cryptography
pip3 install cryptography

完成。

posted @ 2023-02-09 23:53  高柴小生  阅读(305)  评论(0编辑  收藏  举报