0

This line

from cryptography.hazmat.backends import default_backend

is creating this error

Traceback (most recent call last):
  File "C:/Users/user/PycharmProjects/crypto/venv/cryptography.py", line 2, in <module>
    from cryptography.hazmat.backends import default_backend
  File "C:\Users\user\PycharmProjects\crypto\venv\cryptography.py", line 2, in <module>
    from cryptography.hazmat.backends import default_backend
ModuleNotFoundError: No module named 'cryptography.hazmat'; 'cryptography' is not a package

Process finished with exi
Ralf
  • 16,086
  • 4
  • 44
  • 68

2 Answers2

7

You named your file cryptography.py. That conflicts with (and takes precendence over) cryptography package.

Rename your file name to (something that isn't a well known module / package name) e.g. cryptography_test.py (consider a valid Python identifier name, if you'll ever need to import it from another script), and you should be fine.

More info:

CristiFati
  • 38,250
  • 9
  • 50
  • 87
0

i was getting that error when i use from arcgis import GIS

it worked after ive dont this conda install -c conda-forge protobuf pip install --no-cache arcgis --user

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 16 '23 at 09:20