ModuleNotFoundError: No module named 'Crypto' Error

achilles59 picture achilles59 · Aug 13, 2018 · Viewed 45.7k times · Source

I have installed pycryptodomex module on python 3.6.5 but when i try to execute the below call, i get the error mentioned in the headline

from Crypto.Cipher import AES

I want to encrypt a file using AES. How to proceed now ?

Answer

NoorJafri picture NoorJafri · Aug 13, 2018
>> pip install pycryptodome

from Crypto.Cipher import AES  #Works

or

>> pip install pycryptodomex
from Cryptodome.Cipher import AES 

For python3 the package name is now pycryptodome or pycryptodomex

If you need compatibility with your project with Python2 use pycryptodome or else use pycryptodomex which is a library independent of the old PyCrypto.