I am trying to build python scripts in Pycharm to run in ArcGIS Pro 2.2.2. When I run a script which includes "import arcpy" I get the following Error message:
Traceback (most recent call last):
File "C:/Users/vmrenfor/Python Scripts/venv/Scripts/Dapp Uploads.py", line 2, in <module>
import arcpy
ModuleNotFoundError: No module named 'arcpy'
How do I get around this? I am a novice to python and the terminology that goes along with it, so please be specific and write out acronym meanings the first time you type it.
Please see my and Shaun Walbridge's replies to https://community.esri.com/thread/219641-can-arc-gis-pro-intergrate-with-jetbrains-pycharm. If you have questions after reading the Esri and Jet Brains documentation, you can ask follow-up questions here.
Hi Josh,
In following the steps in the Configuring Python Interpreter - Help | PyCharm, I get stuck at step 3, "Specify the location of the Conda executable file in the text field, or click and find location in the Conda installation directory." What is the "Conda executable file"? Was this installed with Conda? What format is it in? Where should I expect to find it?
It depends where you chose when you installed ArcGIS.
For me its this file here:
C:\Program Files\ArcGIS\Pro\bin\Python\python.exe
Starting with ArcGIS Pro 2.2, there is no python.exe in that path anymore. The base/bundled python.exe is under the arcgispro-py3 virtual environment:
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe
If your Pro-bunded Python interpreter is going to be your primary interpreter with PyCharm, I suggest Configuring System Interpreter - Help | PyCharm using the the base/default Pro virtual environment.
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe
When I go through the above mentioned path and find python.exe, and set that location as the Conda executable file I receive the below failure message.
But I do find this file when I follow the path in windows explorer...
As the screenshots in the PyCharm documentation state, you will need admin permissions to the install packages for the system interpreter? Do you have admin permissions to the folder?
Thinking of the changes Esri made to the bundled Python interperter in Pro, it might be best to just go with per-project virtual environment instead and selecting an existing interperter instead of creating a new one.
From Configuring Virtualenv Environment - Help | PyCharm:
If Existing environment is selected:
Specify the required interpreter: use the drop-down list, or click and find one in your file system.
Select the check-box Make available to all projects, if needed.
Click OK to complete the task.
Any idea how to get around the below stated issue?