AnsweredAssumed Answered

Trying to run a Python script on an ArcGIS Server that has Desktop installed.

Question asked by brandi_kirchhoff@fws.gov_fws on Jul 28, 2017
Latest reply on Aug 3, 2017 by brandi_kirchhoff@fws.gov_fws

I have ArcDesktop 10.5 installed on an ArcGIS for Server 10.5 virtual machine (AWS).  I am trying to develop a script to be run automatically that will provide me with Statistics Analysis information.  I originally created the script on my laptop using local SDE connections and folders without any issues but when I copy it and try to modify it on the ArcGIS Server machine, it doesn't work.   When I try to run the Python script on the ArcGIS Server machine, I get that the input table does not exist or not supported. Therefore, I confirmed that I could run the Statistics Analysis tool in ArcCatalog and ArcMap on the ArcGIS Server. I have copied the Python snippet from the ArcGIS Server machine version of ArcCatalog and ArcMap copying the database connection information from the database connection properties window in ArcCatalog and it still give me the same error.  I am wondering if Python is getting confused with the 64-bit Oracle client which would not be defined from ArcDesktop software (32-bit Oracle client is used).  


I have commented out the variable that contained the path copied from ArcCatalog and used arcpy.CreateDatabaseConnection_management to create the same SDE connection but it still does not work and I even stored the sde connection file in the folder with the script.  I have tried defining the workspace using the Python created SDE connection and one specific feature class but I get the "RuntimeError: Object: Error in accessing environment <workspace>" error.  


Has anybody had any success in running automated scripts on an ArcGIS Server machine that uses ArcDesktop geoprocessing tools accessing an SDE connection from Python?  I would greatly appreciate any assistance with this issue.  Thank  you!!  PS - Not sure if it matters but I am using Oracle 11g as my enterprise database.