0
>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\__init__.py", line 22, in <module>
    from arcpy.geoprocessing import gp
  File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
    import arcgisscripting
ImportError: DLL load failed: The specified module could not be found.

What does it mean?

By the way,I have downloaded python 3.7 for studying, which means I may have two python interpreter in my system.

Is it the reason I can't import arcpy?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
HolgerWu
  • 9
  • 1
  • Please edit your question to specify which python interpreter you have set in File->Settings->Project Interpreter and if it's different to the interpreter in the Run->Edit Configurations... for your script. – user2856 Aug 09 '19 at 11:57
  • 2
    This isn't a duplicate, although the symptoms are the same, and the answers to Why can't I import arcpy? are completely irrelevant to PyCharm. – user2856 Aug 10 '19 at 02:29
  • 1
    https://gis.stackexchange.com/questions/14713/setting-up-pycharm-to-reference-arcpy – klewis Aug 12 '19 at 20:28

1 Answers1

1

Set your python interpreter in File->Settings->Project Interpreter to C:\Python27\ArcGIS10.5\python.exe and you may need to change the run/debug interpreter for your script in Run->Edit Configurations... to the same python.exe.

user2856
  • 65,736
  • 6
  • 115
  • 196