Fix Python – ImportError: No module named Crypto.Cipher

Question

Asked By – Graham Smith

When I try to run app.py (Python 3.3, PyCrypto 2.6) my virtualenv keeps returning the error listed above. My import statement is just from Crypto.Cipher import AES. I looked for duplicates and you might say that there are some, but I tried the solutions (although most are not even solutions) and nothing worked.

You can see what the files are like for PyCrypto below:

Now we will see solution for issue: ImportError: No module named Crypto.Cipher


Answer

I had the same problem (though on Linux). The solution was quite simple – add:

libraries:
- name: pycrypto
  version: "2.6"

to my app.yaml file. Since this worked correctly in the past, I assume this is a new requirement.

This question is answered By – Patrick Jordan

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0