Running ArcPy on ArcGIS Linux

ArcGIS Linux runs arcpy using wine [1]. Python is a simple wrapper in bash.

Step-by-step guide

  1. /arcgis/server/tools/python
  2. >>import arcpy, os
    >> sdList = os.listdir('c:/')
    >> print sdList
    ['Program Files', 'Program Files (x86)', 'ProgramData', 'Python27', 'users', 'windows
    

Python3 via Wine cmd

See [2] for running conda like Windows environment.

  1. $. /arcgis/server/framework/etc/arcenv
  2. $wine cmd
  3. cd c:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts
  4. conda create --clone arcgispro-py3 --prefix "Z:\home\arcgis\bin\Python\envs\test"
  5. proswap Z:\home\arcgis\bin\Python\envs\test
  6. conda install pyarrow
    1. This will install packages under Z:\home\arcgis\bin\Python\envs\test
  7. Run python and test import.

Python3 via Wine only

  1. Set up path for wine.
  2. $. /arcgis/server/framework/etc/arcenv
  3. Execute python3 under wine.
  4. $wine /arcgis/server/framework/runtime/ArcGIS/bin/Python/envs/arcgispro-py3/python.exe 
  5. Alternatively, you can run python in custom environment.
  6. $wine /home/arcgis/bin/Python/envs/test/python.exe
Information Icon ArcGIS Python doesn't include GDAL but it has many APIs [3].

References

  1. https://www.linux.org/threads/running-windows-batch-files-on-linux.11205/
  2. https://enterprise.arcgis.com/en/server/latest/publish-services/windows/deploying-custom-python-packages.htm
  3. https://pro.arcgis.com/en/pro-app/arcpy/classes/raster-object.htm

Page Last Updated: Jul 9, 2021 at 12:59 PM EDT