Offline

Use the ArcGIS API for python in a disconnected enivronment.

Steps

1. While in a connected environment, download the appropriate software you'll need:

  • the latest version of the full Anaconda for Python 3x for your OS

  • the appropriate version of the API for Python package for your OS from Esri's channel on anaconda.org

  • The file names appear in this pattern: platform/arcgis-x.x.x-pyZZyyyyyyy-y.tar.bz2.

    Find your file by substituting:

    • your operating system platform for platform
    • the API release number for x.x.x
    • your Python version for ZZ.
    • The yyyyyyy_y refers to a hash number created for each conda package uploaded to the channel

    For instance, if you are installing the Python API 1.6.2 on Windows 64-bit for Python 3.7, download the win-64/arcgis-1.6.2-py37h42bb103_633.tar.bz2 package.

2. Configure Anaconda for use in the disconnected enviroment:

  • Install Anaconda from your install location. Once installed, you can use the Anaconda Navigator GUI application or the Anaconda Prompt command line console to operate the software. The procedure below outlines using the Anaconda Prompt and the conda utility on Windows:

    First, open Anaconda Prompt. All subsequent commands are run inside this prompt:

    Start > Anaconda3 (64-bit) > Anaconda Prompt

    1. Configure Anaconda for offline use. See Conda Configuration for full details:

      conda config --set offline True

    2. Create a new environment, including python and six packages:

      conda create -n <my_env_name> python six

    3. Activate the environment:

      conda activate <my_env_name>

    4. Install the API for Python package, having downloaded the bz2 file that matches the appropriate platform, Python version and API release you are using:

      conda install /path_to_package_download_folder/platform/arcgis-x.x.x-pyZZyyyyyyy-y.tar.bz2

      The conda utility will pull all the arcgis package dependencies from the installed set of Anaconda libraries instead of searching the internet.

3. Verify the install:

At this point, all modules, classes and functions are available in the API for use in your Python scripts or Jupyter notebooks except the Map Widget. You can verify your install by making a connection to your GIS and printing properties:

Use dark colors for code blocksCopy
1
2
  gis = GIS("url_to_your_gis", "username", "password")
  print(f"Connected to {gis.properties.portalHostname} as {gis.users.me.username}")

The map widget is only supported within Jupyter applications. Follow these additional steps to use the map widget in a disconnected environment:

  • install the jupyterlab package for visualizing with maps in either Jupyter Notebook or Jupyter Lab:

    conda install jupyterlab

  • enable the map widget by running these 2 commands in succession:

    1. jupyter nbextension enable --py --sys-prefix widgetsnbextension
    2. jupyter nbextension enable --py --sys-prefix arcgis
  • proceed to Test your install with the Jupyter Notebook to verify the proper installation of the map widget.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.