ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Deploying custom Python packages for ArcGIS Server

  • ArcGIS Server for Windows
  • ArcGIS Server for Linux
  • Testing custom Python packages

ArcGIS Server on Windows and Linux includes Python 2.7 for Windows 64 bit. The Python installation of ArcGIS for Server includes additional packages such as numpy and matplotlib. However, if you wish to install additional custom Python packages, follow the steps below.

ArcGIS Server for Windows

  1. Download the Windows 64-bit version of the package.
  2. Browse to your download location.
  3. Double-click the .msi or .exe file to install the package.

ArcGIS Server for Linux

  1. Download the Windows 64-bit version of the package.
  2. Start the wine explorer application. At the terminal, paste this command:

    . <ArcGISServer_InstallDir>/arcgis/server/framework/etc/arcenv; wine explorer &

  3. Browse to your download location (remember that Z:\ is mapped to your system's /.)
  4. Double-click the .msi or .exe file to install the package.
  • Custom packages typically install into the following directories:
    • Windows: C:\Python27\ArcGISx6410.2\lib\site-packages
    • Linux: <ArcGISServer_InstallDir>/arcgis/server/framework/runtime/.wine/drive_c/Python27/ArcGISx6410.2/lib/site-packages

Testing custom Python packages

To test that the package installed properly, write a Python script that imports the package you installed and run the script. If you are unfamiliar with running stand-alone scripts, follow the steps below:

  1. Open the terminal window.
  2. Run the server's Python with the script as an argument, for example:<ArcGISServer_InstallDir>/arcgis/server/tools/python ~/projectX/mytestscript.py

Note:

The Python libraries installed by an ArcGIS Linux Server installation is Windows 64-bit Python. Therefor, stand-alone Python scripts should always use the Windows path separator (\) when accessing data and other Python modules. Also, be aware that there is a Z:\ which is mapped to the Linux systems' /. Within a Python script you can access data and other Python modules using Z:\ mapping. For example, data in /myuser/myproject/data can be accessed as z:\myuser\myproject\data.

This does not apply to Python scripts you publish from ArcGIS for Desktop because the publishing process converts all paths to the correct format.

Related topics

  • Essential ArcPy vocabulary

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2020 Esri. | Privacy | Legal