Search code examples
pythonpycharmpycrypto

PyCharm IDE will not load from Crypto.Cipher import AES


I can run python3 myfile.py on the MAC OS command line and it works fine, but inside the IDE, I get the following error. I have done the

pip uninstall pycrypto
pip install pycrypto

This has no effect inside the PyCharm IDE, but it does work with the command line.

Python is 3.7 inside and outside the IDE. The pycrypto is installed via the Preferences -> Project -> Project Interpreter. The version of pycrpto is 2.6.1.

What am I missing?

    /Users/denisputnam/git/kingslanding/venv/bin/python /Users/denisputnam/git/kingslanding/denisputnam-cryptography-overview-exercise/mysymmetricencryptiondecryption.py
Traceback (most recent call last):
  File "/Users/denisputnam/git/kingslanding/denisputnam-cryptography-overview-exercise/mysymmetricencryptiondecryption.py", line 4, in <module>
    from Crypto.Cipher import AES 
ModuleNotFoundError: No module named 'Crypto'

Process finished with exit code 1

Solution

  • Look into the following troubleshooting page.

    According to your console output, you need to run /Users/denisputnam/git/kingslanding/venv/bin/python /Users/denisputnam/git/kingslanding/denisputnam-cryptography-overview-exercise/mysymmetricencryptiondecryption.py from the system terminal and see if it works.