Python ImportError No module named crypto.PublicKey.RSA

If you are using Python 3.7, it already exists. Just change the folder name in C:\Users\username\AppData\Local\Programs\Python\Python37\Lib\site-packages from crypto to Crypto


The correct package to install is pycrypto.

pip install pycrypto

Should work on most platforms, otherwise get Pip from https://pip.pypa.io/en/stable/

Edit: As mentioned in the comments below, pip install pycryptodome installs a newer, drop-in replacement for pycrypto and is the better option going forward.


Rename crypto directory under “Lib/site-packages” to Crypto, then importing will work.

Tags:

Python