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?
Best Answer
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 runc:\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: