Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no module named crypto.cipher

I'm trying my hands on encryption for a while now. I recently got hands on this python based crypter named PythonCrypter.

I'm fairly new to Python and when I try to open the CodeSection.py file via terminal, I get error saying from Crypto.Cipher import AES ImportError: No Module Named Crypto.Cipher

What am I doing wrong?

like image 443
Arion_Miles Avatar asked Jul 17 '15 21:07

Arion_Miles


4 Answers

pip uninstall Crypto
pip uninstall pycrypto
pip install pycrypto

That works for me.

The point is, when you install pycrypto, you should remove Crypto first

like image 147
bin456789 Avatar answered Oct 06 '22 11:10

bin456789


I just encountered this issue with Python 2.7 on Windows. My solution was to rename the folder from ..\site-packages\crypto to ..\site-packages\Crypto. The lower case "c" was causing the import error.

See https://github.com/pypa/pip/issues/3309 for details.

like image 23
thephez Avatar answered Oct 06 '22 11:10

thephez


In order to use the pycypto library you should install it with:

pip install pycrypto

or

easy_install pycrypto
like image 8
omri_saadon Avatar answered Oct 06 '22 11:10

omri_saadon


PyCrypto doesn't play well with Windows systems if you're installing using pip or easy_install... or at least it didn't for me.

Try using the prebuilt binaries for Windows here: http://www.voidspace.org.uk/python/modules.shtml#pycrypto

like image 3
johnny_be Avatar answered Oct 06 '22 11:10

johnny_be