ModuleNotFoundError No module named Crypto

+2 votes

Hi. I am trying to run this line in python.

from Crypto.Cipher import AES

But I am getting this error

ModuleNotFoundError: No module named 'Crypto'

I tried installing the module using

pip install crypto

It was successful but when I ran the code, I still get the same error

Aug 20, 2019 in Python by Rishi
86,481 views

3 answers to this question.

+2 votes

The module you’ve installed is different.

To install the module that you are tying to use, run the following code:

pip install pycryptodome
answered Aug 20, 2019 by Raman
Cool, thanks for you help.

I can solve.
Thanks a lot.
Still I am unable to solve the issue

Hi, @Harika,

I had the same problem (though on Linux). The solution was quite simple - add:

libraries:
- name: pycrypto
  version: "2.6"
i already doing that but still get same error
0 votes

I had the same problem on my Mac when installing with pip. I then removed pycrypto and installed it again with easy_install, like this:

pip uninstall pycrypto
easy_install pycrypto

also as Luke commented: If you have trouble running these commands, be sure to run them as admin (sudo)

Hope this helps!