Skip To Content

Deploying custom Python packages for ArcGIS Server

At ArcGIS Enterprise 10.5 and later, a Python 3-based conda environment is included with ArcGIS Server.

The Python installation of ArcGIS Server includes packages such as numpy and matplotlib. However, if you want to install additional custom Python packages, follow the steps below.

Services published from ArcGIS Pro

For geoprocessing services published from ArcGIS Pro or the ArcPy module based on your ArcGIS Pro conda environment, you can specify a Python environment for geoprocessing services following the steps below. Because you will be modifying the default Python environment, a backup is encouraged before configuration.

Note:

Most third-party Python packages should work with the wine environment, however, if the package makes WIN32 calls (directly or indirectly interacting with Windows OS), those packages will not function properly even with a successful configuration.

  1. Sign in to your ArcGIS Server machine with the ArcGIS Server account.
  2. Optionally, navigate to the framework etc directory to ensure the wine explorer is running properly. For example, run the following command:

    Sample commands to activate wine explorer when ArcGIS Server is in the /home directory.

    cd /home/arcgis/server/framework/etc
    source arcenv
  3. Next, navigate to the Scripts directory to run the installation commands.

    Sample commands to install the beautifulsoup4 Python package when ArcGIS Server is in the /home directory.

    cd /home/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts
    wine conda install bs4
  4. Restart your ArcGIS Server service. The startserver and stopserver scripts are in the scripts directory of your ArcGIS Server installation.
  5. Repeat the steps above on all other machines if your ArcGIS Server has a multiple machine deployment.