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?
Thanks!
Solved! Go to Solution.
There is a python.exe within the %Pro%\bin\Python\envs\arcgispro-py3 folder which should work if set as a project interpreter in PyCharm.
Have you checked the below link
I'm not running on a machine that has Server installed.
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.
sys.path
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
May be this link might help
There is a python.exe within the %Pro%\bin\Python\envs\arcgispro-py3 folder which should work if set as a project interpreter in PyCharm.
Thank you so much, this works!