Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named 'Crypto'

I am working with pycrypto. It works fine on my local windows machine, but when I move it to my python box I get an error with importing the module:

from Crypto.Cipher import ARC4 
ImportError: No module named 'Crypto'

The output of python3.3 -c "from Crypto.Cipher import ARC4"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'Crypto'

output of pip3 list has a reference includes pycrypto (2.6.1)

I know it works with Python 2.7.6, but I wrote the script in 3.3 so it depends on some things from 3.3

like image 592
crobject Avatar asked Feb 05 '15 22:02

crobject


People also ask

How do I fix No module named Crypto?

The Python "ModuleNotFoundError: No module named 'Crypto'" occurs when we forget to install the pycryptodome module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install pycryptodome command.


1 Answers

As I already wrote in this answer:

WARNING: Don't use pycrypto anymore!

Use pycryptodome instead, via pip3 install pycryptodome.

But make sure that you don't have pycrypto installed, because both packages install under the same folder Crypto.

like image 158
winklerrr Avatar answered Sep 22 '22 03:09

winklerrr