The ArcGIS API for Python is distributed as a conda package named arcgis
. Conda is a popular Python package and environment manager application that helps you install and update packages such as the ArcGIS API for Python and their dependencies.
conda
Open a terminal application, navigate to the directory you want to work in, and activate the conda environment you want to use with the ArcGIS API for Python.
Install the API with the following command:
For 2.3.x:
conda install -c esri arcgis=2.3.*
For more details, see Understanding conda topic.
Pipenv
Pipenv is the official packaging tool for managing environments and installing packages from the Python Package Index (PyPI). To install the ArcGIS API for Python from PyPI in a new environment, create a new folder named your-folder. Then, open a terminal, and run cd /path/to/your-folder to change directories into your-folder. Next, enter the following command to simultaneously create a new environment and install the API in it:
pipenv install arcgis
Install with minimum dependencies
Both conda install -c esri arcgis
and pip install arcgis
will install all of the dependencies outlined in the system requirements section. However, the API can function in a 'stripped down' state with only a few dependencies. This allows developers to deploy the API with minimal footprint in space constrained systems. For this to work, you need to manually manage the dependencies in your environment based on the applications you need to solve and if you don't want to use every feature of the API. As of v1.8.3 of the Python API, the minimum dependencies needed are:
- ujson
- six
- requests (This library has its own dependencies that must be included)
- requests-toolbelt
- requests-ntlm (_This library has its own dependencies that must be included*)
- ntlm-auth
To install the API with no dependencies, simply add the --no-deps
flag to any install command.
with conda:
conda install -c esri arcgis --no-deps
with pip:
pip install arcgis --no-deps
The above set of dependencies should allow you to establish a connection with your web GIS and perform a number of administrative and other tasks which involve processing on your GIS rather than in your Python kernel. Depending on your OS, this set up with minimal dependencies should take up about 50 mb in space. As your needs expand, you can then manually choose which dependencies to add to your Python environment. For instance, you can install pandas if you require to work with spatially enabled DataFrames and jupyter.