greenlaw

Importing arcpy fails with ArcGIS Engine Runtime for Linux

Discussion created by greenlaw on Jun 3, 2013
Latest reply on Mar 20, 2015 by Griffin_Morgan-esristaff
I have an ArcGIS Engine Runtime 10.1 SP1 for Linux installation on RHEL 6 x86_64, and while I am able to run Java ArcObjects code without problems, I cannot seem to get arcpy to import using the packaged python interpreter.

My $DISPLAY variable is set correctly and I believe I am sourcing the required files ($ENGINE_HOME/vmw/setenv_mw.sh and $ENGINE_HOME/python27/setenv_python.sh).  I'm using the python interpreter packaged with arcpy:  $ENGINE_HOME/python27/bin/python.  I have all the required packages installed (the ones listed under the "Linux" link at the bottom of this page: http://resources.arcgis.com/en/help/system-requirements/10.1/index.html#//015100000068000000).

Here is the output:

[arcengine@nimbus engine10.1]$ ./python27/bin/python
Python 2.7.2 (default, Feb 23 2012, 12:21:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/esri/arcgis/engine10.1/python27/lib/python2.7/site-packages/arcpy/arcpy/__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "/usr/local/esri/arcgis/engine10.1/python27/lib/python2.7/site-packages/arcpy/arcpy/geoprocessing/__init__.py", line 14, in <module>
    from _base import *
  File "/usr/local/esri/arcgis/engine10.1/python27/lib/python2.7/site-packages/arcpy/arcpy/geoprocessing/_base.py", line 592, in <module>
    env = GPEnvironments(gp)
  File "/usr/local/esri/arcgis/engine10.1/python27/lib/python2.7/site-packages/arcpy/arcpy/geoprocessing/_base.py", line 589, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "/usr/local/esri/arcgis/engine10.1/python27/lib/python2.7/site-packages/arcpy/arcpy/geoprocessing/_base.py", line 545, in __init__
    self._refresh()
  File "/usr/local/esri/arcgis/engine10.1/python27/lib/python2.7/site-packages/arcpy/arcpy/geoprocessing/_base.py", line 547, in _refresh
    envset = (set(env for env in self._gp.listEnvironments()))
RuntimeError: NotInitialized


Importing arcpy works fine for ArcGIS Server 10.1 for Linux, but I can't get it to work for Engine.

Has anyone gotten arcpy to import properly in Linux ArcGIS Engine Runtime 10.1? 

Thanks
Jason

Outcomes