"cryptography is required for sha256_password or caching_sha2_password"
"This report means that sha256_password with caching_sha2_password These two encryption algorithms need to use cryptography.
Although the meaning is clear, you may not know how to solve it.
Actually, cryptography is a python package, so the solution is simple:"
Try running pip install cryptography
on you cmd or terminal.
Here is the source.
For what it's worth, I had this problem today using MySQL via SQLAlchemy in Python. It turned out that I was using the wrong password for this account. In other words, if you have this problem, you might want to start by just confirming that you're using the correct password.
FWIW, I am not sure why this generated a cryptography message. Something buggy along the way?
To use “sha256_password” or “caching_sha2_password” for authenticate, you need to install additional dependency:
$ python3 -m pip install PyMySQL[rsa]
Source: https://pymysql.readthedocs.io/en/latest/user/installation.html
The error message can be made more comprehensive and helpful. In order to fix this "cryptography" package needs to be installed.
pip install cryptography