10

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

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
crobject
  • 103
  • 1
  • 1
  • 4

3 Answers3

14

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.

winklerrr
  • 13,026
  • 8
  • 71
  • 88
4

I am assuming that your "python box" is a remote computer.

First, make sure pycrypto is up to date (pip3 install --upgrade pycrypto). The older versions may not be compatible with python 3.3

If that doesn't work, try looking in site-packages (the directory) to make sure the functions actually exist.

If none of that works, it might be easier (just a suggestion) to use from future import the things you need. That way it is python 2&3 compatible.

IronManMark20
  • 1,298
  • 12
  • 28
0

Use pycryptodome, either install using pip or in case using IDE like pycharm install as a package via Preferences.

In case still gives error, use pycryptodomex (different from pycryptodome).

You will not see any error in importing from Cryptodome.Cipher import AES

1

vimuth
  • 5,064
  • 33
  • 79
  • 116