I'm by far an expert when it comes to Python...so, I generally use PyCharm when it comes to writing scripts as I find it to be a great IDE for Python.
I'm starting the process of moving some of my 2.7.x scripts to 3.5.x for use with ArcGIS Pro. I have configured PyCharm to use the python interpreter packaged with ArcGIS Pro 1.4.1, located at the following: C:\Program Files\ArcGIS\Pro\bin\Python.
However, arcpy is not recognized as an available module.
If I run sys.path from within PyCharm, I get the following paths:
If I run sys.path from within ArcGIS Pro, I get the following paths:
What do I need to do in order to get PyCharm to be able to use arcpy? Do I need to add system environmental variable paths? If so, from the list returned in ArcGIS Pro, how many need to be added?
Is there some other way of getting the arcpy module to be recognized within PyCharm?
Is there a best practice that is used with python?
Solved! Go to Solution.
I was able to add in content source folders for my project, and when running sys.path, it returns the folders that are shown within ArcGIS Pro (screenshot below), but I am still getting an error that a module can't be found.
error message with importing arcpy
Not sure about pro but in Desktop the below tip from arcgis help worked. THere must be something equivalent in pro as well
If importing ArcPy produces either of the following errors, the required modules could not be found:
To address this, browse using Windows Explorer to the python26\Lib\site-packages folder and add or edit the Desktop10.pth file. The file should contain the two lines shown below (corrected to your system's path if they do not match):
c:\Program Files\ArcGIS\Desktop10.0\arcpy c:\Program Files\ArcGIS\Desktop10.0\bin