lionheart
lionheart

Reputation: 333

PyCharm says No Module named Crypto

I keep getting an import error saying:

ModuleNotFoundError: No module named 'Crypto'

I have gone over various other answers about how to resolve this, but it does not mention how I can resolve the issue in PyCharm.

I originally tried to pip3 install pycrpyto in the Pycharm terminal, but it would not install. Then I hear about pycryptodome and was able to install it properly. However, when I type import Crypto , it keeps saying that the module was not found. How is this issue resolved in Pycharm.

Upvotes: 2

Views: 7063

Answers (2)

Goutham Mosya
Goutham Mosya

Reputation: 44

  • Go to settings-->project:project_name-->Project Interpreter
  • now you can see plus(+) symbol beside project,version,latest version (table), click on that
  • a new tab will appear, type the package you want to install and click on install package which is at the left bottom of that tab

Note: check if it is capital c or small c, the packages are case sensitive

Upvotes: 2

Arvind NK
Arvind NK

Reputation: 19

Go to: Pycharm>File>Settings>Python Interpreter> click +

Search for the package: Crypto or cryptography

and click install.

If the install fails with the SSL error: Could not fetch URL https://pypi.org/simple/crypto-mediator/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/crypto-mediator/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping

Go back to the same page and after selecting the package click on the checkbox Options and mention: --trusted-host pypi.org --trusted-host files.pythonhosted.org and then install the package

Upvotes: 1

Related Questions