Python has a rich collection of packages that can be used in ArcGIS Pro. To simplify the use of Python packages, ArcGIS Pro includes a package management system called conda. Conda takes the guesswork and hassle out of installing and updating packages and their dependencies.
To further extend the versatility and utility of Python packages, multiple installations of Python can coexist on a single workstation, independent of one another. Each of these installations is referred to as a Python environment. 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.
Installation using Python Package Manager
Starting from version 2.5, ArcGIS Pro releases ship with conda and the arcgis
package pre-installed. The functionality of conda is integrated into ArcGIS Pro through the Python Package Manager
. The Python Package Manager removes many of the hurdles faced when writing Python code. It supports installing open-source and third-party libraries that are associated with an individual project, rather than the base Python installation. This simplifies the process of successfully sharing complex Python tools across multiple computers.
ArcGIS Pro 2.5 and later provide the Python Package Manager GUI to download and install any conda package. Access it through the ArcGIS Pro backstage area:
- Open ArcGIS Pro with a new blank Project
- Select the Project tab to access the Pro backstage (see screen shot below)
- Select the Package Manager menu option
- You will see a list of packages installed in the default arcgispro-py3 environment. In order to add more packages, you do the following:
- click on the Environment Manager button, then click Clone arcgispro-py3.
- Modify the path and name if you choose, and click OK
- Allow environment creation to complete. Proceeding before this completes could result in an incomplete environment that may not perform properly.
- Select the new environment, right-click and select Activate, and click OK when complete
- The environment is now the active environment.
You can now review the Installed packages, as well as use the Updates and Add Packages options to modify this cloned environment to meet your needs.
NOTE: You cannot use the Python Package Manager to upgrade the arcgis package. Proceeed to the Upgrade Package section for instructions on upgrading the arcgis package.
Installation using Python Command Prompt
ArcGIS Pro provides the Python Command Prompt to download and install any conda package.
-
Navigate to Start Menu > All Programs > ArcGIS > Python Command Prompt
In order to add more packages, you need to create a clone of the default arcgispro-py3 environment. Follow the steps to create environment. You can change the default environment to the cloned environment using the command: proswap <new enviroment name
. Alternatively, to work with the activated environment, use conda utility to activate other environments.
-
Enter the following at the prompt:
conda install -c esri arcgis=
<release _number > -
Entering no release number upgrades the
arcgis
package to the current release of the API for Python.
Upgrade package
NOTE: The default arcgispro-py3 environment cannot be modified. Clone the default environment in order to create environments where packages can be updated. The Python Package Manager cannot be used to update the arcgis
package. Use the Python Command Prompt as described below.
-
Upgrade arcgis package using Python Command Prompt:
-
Navigate to Start > ArcGIS > Python Command Prompt
-
Activate the environment containing the arcgis package to upgrade. Enter the following at the prompt for an environment named arcggispro-py3-clone:
activate arcgispro-py3-clone
-
Upgrade the arcgis package to the current release by installing from the esri channel with no release number. Enter the following at the prompt:
conda install -c esri arcgis
-