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:
I solve this problem by change the first letter case to upper. Make sure ''from Crypto.Cipher import AES'' not ''from crypto.Cipher import AES''.
For CentOS 7.4 I first installed pip and then pycrypto using pip:
This problem can be fixed by installing the C++ compiler (python27 or python26). Download it from Microsoft https://www.microsoft.com/en-us/download/details.aspx?id=44266 and re-run the command :
pip install pycrypto
to run the gui web access when you kill the process ofeasy_install.exe
.Worked for me (Ubuntu 17.10)
Removing venv and creating it again with python v3.6
Pycrypto is deprecated, had problems with it, used Pycryptodome
I found the solution. Issue is probably in case sensitivity (on Windows).
Just change the name of the folder:
C:\Python27\Lib\site-packages\crypto
C:\Python27\Lib\site-packages\Crypto
This is how folder was named after installation of pycrypto:![enter image description here](https://i.stack.imgur.com/DfHD9.png)
I've changed it to:![enter image description here](https://i.stack.imgur.com/wqj8y.png)
And now the following code works fine:![enter image description here](https://i.stack.imgur.com/iirOc.png)
I had the same problem (though on Linux). The solution was quite simple - add:
to my app.yaml file. Since this worked correctly in the past, I assume this is a new requirement.