close

[Solved] ImportError: No module named Crypto.Cipher

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to import from Crypto.Cipher import AES But I am facing following error ImportError: No module named Crypto.Cipher in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ImportError: No module named Crypto.Cipher Error Occurs ?

I am trying to import from Crypto.Cipher import AES But I am facing following error.

ImportError: No module named Crypto.Cipher

How To Solve ImportError: No module named Crypto.Cipher Error ?

  1. How To Solve ImportError: No module named Crypto.Cipher Error ?

    To Solve ImportError: No module named Crypto.Cipher Error You just need to reinstall pycrypto so that First of all uninstall pycrypto and then reinstall it. To uinstall pycrypto use this command. pip uninstall pycrypto. Now install pycrypto again with easy install. Use this command. easy_install pycrypto Now your error should be solved. Second solution is Here pycrypto is no longer safe. Use pycryptodome instead, it is a drop-in replacement. So First of all you need to uninstall all versions of crypto and pycrypto first, then install pycryptodome: pip3 uninstall crypto then pip3 uninstall pycrypto and pip3 install pycryptodome.

  2. ImportError: No module named Crypto.Cipher

    To Solve ImportError: No module named Crypto.Cipher Error You just need to reinstall pycrypto so that First of all uninstall pycrypto and then reinstall it. To uinstall pycrypto use this command. pip uninstall pycrypto. Now install pycrypto again with easy install. Use this command. easy_install pycrypto Now your error should be solved. Second solution is Here pycrypto is no longer safe. Use pycryptodome instead, it is a drop-in replacement. So First of all you need to uninstall all versions of crypto and pycrypto first, then install pycryptodome: pip3 uninstall crypto then pip3 uninstall pycrypto and pip3 install pycryptodome.

Solution 1: Reinstall pycrypto

You just need to reinstall pycrypto so that First of all uninstall pycrypto and then reinstall it. To uinstall pycrypto use this command.

pip uninstall pycrypto

Now install pycrypto again with easy install. Use this command.

easy_install pycrypto

Now your error should be solved.

Solution 2: remove crypto and pycrypto

Just need to remove crypto and pycrypto with this command.

sudo pip uninstall crypto

Then,

sudo pip uninstall pycrypto

and reinstalling pycrypto:

sudo pip install pycrypto

Now, you can import it in your file just like this.

from Crypto.Cipher import AES

Solution 3: pycryptodome instead of pycrypto

Here pycrypto is no longer safe. Use pycryptodome instead, it is a drop-in replacement. So First of all you need to uninstall all versions of crypto and pycrypto first, then install pycryptodome:

pip3 uninstall crypto 
pip3 uninstall pycrypto 
pip3 install pycryptodome

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

2 thoughts on “[Solved] ImportError: No module named Crypto.Cipher”

Leave a Comment