Installing python packages to be used alongside arcpy

Summary

In order to use additional python packages in scripts that also use arcpy, the packages must be installed in a virtual environment within the ArcGIS python installation. This document describes how to do this.

Environment

  • Windows operating systems
  • ArcGIS Pro installed

Directions

Packages can be installed manually from the command line or using the Python management tools within ArcGIS Pro. The manual procedure is described below. The ArcGIS Pro procedure can be found on the ArcGIS Pro Python reference page.

  1. Locate the ArcGIS installation directory. The default installation location is C:\Program Files\ArcGIS\Pro.
  2. Run a Windows command prompt as Administrator and navigate to this ArcGIS directory.
  3. Within this directory, navigate to bin\Python\envs.
  4. (Optional) Type dir to get a directory listing of existing environments. Results should include the default ArcGIS python environment, arcgispro-py3.
  5. Activate the desired environment: activate env-name, where env-name is the name of the new environment; for example: activate arcgispro-py3.
  6. Install the desired package using pip install package-name, where package-name is the package to install.

External Resources

If project-specific packages are being installed, it's good practice to create a new virtual environment to use instead of the default arcgispro-py3 environment. Instructions on how to do this can be found in a separate article.

Details

Article ID: 1886
Created
Fri 5/29/20 12:21 PM
Modified
Mon 10/30/23 10:22 AM