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
77,438 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"
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!

answered Dec 16, 2020 by Gitika
• 65,910 points
0 votes
>> 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.

answered Dec 16, 2020 by Nikita

Related Questions In Python

+1 vote
3 answers
0 votes
1 answer

Python: ImportError: No module named Crypto.Cipher

Seems like the pycrypto package is not ...READ MORE

answered Jul 31, 2019 in Python by Hari
23,494 views
+2 votes
3 answers

ModuleNotFoundError: No module named 'cv2'

Hi@akhtar, This error may occur if you didn't install ...READ MORE

answered Apr 9, 2020 in Python by MD
• 95,440 points
266,181 views
0 votes
2 answers

ModuleNotFoundError: No module named 'pythoncom' in pyttsx3

even i faced the same problem ...just ...READ MORE

answered Jun 2, 2020 in Python by anonymous
12,964 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,058 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
3,479 views
0 votes
1 answer

No module named urllib3

It is possible that either urllib3 is ...READ MORE

answered Jan 24, 2019 in Python by SDeb
• 13,300 points
8,530 views
0 votes
1 answer

No module named __future__

In your /PATH/Python-2.7.x/Lib should be all your ...READ MORE

answered Mar 7, 2019 in Python by SDeb
• 13,300 points
4,393 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP