ArcGIS Pro provides access to a large collection of Python packages. To support Python packages, ArcGIS Pro includes a package management system named conda. ArcGIS Pro integrates conda with the Package Manager page. You can also access conda from a command prompt.
To further extend the versatility and utility of Python packages, multiple Python environments can coexist on a single workstation, independent of one another. Each Python environment can have its own set of packages, allowing you to switch between sets of Python functionality without uninstalling and reinstalling packages each time.
By default, ArcGIS Pro has a single conda environment, arcgispro-py3, which includes all Python libraries used by ArcGIS Pro as well as several others, such as scipy and pandas.
- Clone an environment
- Activate an environment
- Add an environment
- Delete an environment
- Upgrade an environment
- Repair an environment
- Add or remove a package
- Update a package
Precaución:
Modifying the ArcGIS Pro default Python environment (arcgispro-py3) is not advisable and may result in unintended consequences. It is recommended that you only modify a cloned environment.
Access conda from a command prompt
From a command prompt, you can access conda functionality using the conda command. The active Python environment is indicated in parentheses at the prompt before the current directory. Use the Python Command Prompt shortcut to open a command prompt window initialized with the active conda environment for ArcGIS Pro.
The following are examples of conda commands.
List packages in the active environment.
conda list
List all conda environments.
conda env list
Clone the default arcgispro-py3 environment to create a new environment named my_env.
conda create --clone arcgispro-py3 --name my_env
To get help for a command, type the help or -h flag after the conda command.
To activate an environment for your current command line session, use the activate command.
activate my_env
For more information about using and working with conda, see Introduction to conda.
In addition, ArcGIS Pro supports additional Esri based commands proswap and propy.
To activate an environment for your current command line session, and set the environment as the new default for future ArcGIS Pro and command line sessions use the proswap command.
proswap my_env
You can open a Python session in the active environment with the propy command and run Python scripts using the following format:
propy yourscript.py
Network access for creating environments and installing packages
Creating conda environments and installing packages requires an internet connection. If you're trying to clone an environment from behind a firewall, the following sites may need to be put on an allow list in your network's firewall settings:
- https://conda.anaconda.org
- https://repo.anaconda.com