Install ArcPy

The ArcPy package is part of the default Python distribution arcgispro-py3 that is provided with ArcGIS Pro and ArcGIS Server.

Create an environment with ArcPy by cloning arcgispro-py3. You can clone an environment using the Package Manager in ArcGIS Pro, or the conda command line application from the Python Command Prompt.

Attention :

Modification of the default arcgispro-py3 Python environment itself is not recommended. Modifying an environment may make it unusable in some cases and any clones of the arcgispro-py3 environment will include the changes. If the arcgispro-py3 environment is in a bad state, functionality in the ArcGIS Pro application can also be in a bad state. You may need to uninstall and reinstall ArcGIS Pro.

Beginning with ArcGIS Pro 2.7, you can add ArcPy to an existing Python 3 environment, as long as its package versions are not in conflict. To add ArcPy, use conda to install ArcPy from the Esri channel on Anaconda Cloud. From the Python Command Prompt, run the following command with the appropriate release number:

conda install arcpy=3.2 -c esri
Licence :

Although ArcPy can be added to an environment, the package still requires ArcGIS Pro, which must be installed to use ArcPy.

arcpy-base

The default Python environment included with ArcGIS Pro, arcgispro-py3, includes access to more than 200 packages used to support all ArcGIS Pro Python use cases.

In some circumstances, this environment may include much more than you require. If you only need a simple environment, that is, an environment that includes only the minimum dependencies to run geoprocessing tools and core ArcPy functions, use the arcpy-base environment. arcpy-base is significantly smaller than arcgispro-py3 and includes only a couple dozen of dependencies.

To create an environment based on arcpy-base, run the following conda command:


conda create -n my-env arcpy-base

With a limited set of libraries, arcpy-base does not fully support all ArcGIS Pro functionality that is based on Python. arcpy-base can still be used to run almost all geoprocessing tools and ArcPy functions, and includes packages such as NumPy, GDAL, and Pandas. Using only arcpy-base will restrict access to Notebooks (both from within and outside ArcGIS Pro), ArcGIS API for Python, and many other libraries including matplotlib, pillow, pytest, requests, scipy, sqalachemy, and swat.

Rubriques connexes


Dans cette rubrique
  1. arcpy-base