I'm struggling with running/importing 'numpy and arcpy' on pycharm, which points to python.exe in the Python 27 directory where ArcGIS 10.4 is installed. How else can i try importing the two modules as it gives the errors "ImportError: No module named arcpy" for both arcpy and numpy.
Thanks,
Charlie
I've tried all suggestions to avail. What seems to be working is 'archook', which according to github "Searches the system for arcgis and makes arcpy available to python (regardless of pythonpath/system path/registry settings)". Below is how i've managed to allow import for 'arcpy':
import archook
archook.get_arcpy()
import arcpy
I'm guessing your registry settings or PYTHONPATH variable (which were set by the 3.7 install) are polluting your sys.path.
This archook module must clean up your sys.path. Neat idea.
To see your sys.path:
import sys
print "\n".join(sys.path)
Will do, thanks Curtis
Unless you don't have arcmap installed, the location of the salient registry files may differ