0

I want to have an Anaconda environment that will use the Python interpreter installed with ArcGIS Pro.

I am working in Windows. I have been using Anaconda Prompt to configure virtual environments, and this works fine. However, I would like to create an Anaconda virtual environment that uses the Python interpreter installed with ArcGIS Pro, so that I can import ArcPy and use ArcPy in that environment.

The Python interpreter that I think I should use is in C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

When I run conda info --envs I get something like C:\Users\MyName\Anaconda3 for all of my environments. I think I would like to change that path to C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

Is this the right approach, and is this possible? Is there another (or better) way to use ArcPy in conda environments if I installed Anaconda first?

  • Hi @user150728, thanks for the question. What happens when you run where conda in the command prompt? Does it list C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 or something similar? – jesnes Sep 21 at 17:25
2

No you can't do this.

ArcGIS Pro already includes the conda package management system. It's separate to the Anaconda conda that you installed.

ArcGIS Pro comes with a base read-only conda environment arcgispro-py3.

To use the ArcGIS Pro conda command, use the Python Command Prompt shortcut in your Start Menu -> ArcGIS Pro entry. You can also run c:\Program Files\ArcGIS\Pro\bin\Python\scripts\proenv.bat from any command prompt.

To make changes (install packages etc.) to your ArcGIS Pro python env you need to clone your base env and modify that. Go into ArcGIS Pro -> settings -> python -> manage environments and clone your default arcgispro-py3 environment, then set the new clone as default.

Further information:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.