Select to view content in your preferred language

Arcpy on Linux with ArcGIS Server

3109
1
12-28-2011 11:57 AM
JasonGreenlaw
Regular Contributor
Somehow, I've managed to break my Arcpy [Linux] install.  Previously, I could log in as the install owner ("ags"), open up the python interpreter packaged with ArcGIS Server ("/usr/local/esri/arcgis/server/tools/python") and import arcpy without any problems, but I seem to have done something unforgivable, as I'm now seeing the following error:

Python 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\__init__.py", line 22, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 14, in <module>
    import arcgisscripting
ImportError: DLL load failed: DLL init failed


The only thing I can think of that I've changed is that I installed ArcGIS Engine 10.1 Beta recently on the same server (I tried to install as the same user, but realized that's not a good idea, so I created another user 'arcengine' who now owns the Engine install). 

Could ArcGIS Server and ArcGIS Engine somehow be conflicting?

The following directories are in my LD_LIBRARY_PATH:
/usr/local/esri/arcgis/server/bin/wine/lib64:/usr/local/esri/arcgis/server/bin/wine/lib64/wine


I'm running RHEL6 x86_64.

Thanks in advance for any help,
Jason
Tags (2)
0 Kudos
1 Reply
JasonGreenlaw
Regular Contributor
Well, I was able to solve the problem - this message seems to occur when the DISPLAY environment variable does not point to a valid X location. 

In my case, I'm running this from a Windows machine by using SSH with X-forwarding.  My local X-windows server (Xming) had previously crashed and wasn't restarted, so Arcpy couldn't access it.  Once I restarted it, I was able to load Arcpy without problems.

Alternatively, you can set DISPLAY to point to a valid Xvfb location.

Jason
0 Kudos