I have a fresh install of ArcGIS Server and ArcGIS for Desktop both 10.2, latest patches applied. The data is served in this application from a PostgresSQL enterprise geodatabase.
The problem is that I can connect to the database using ArcMap, on the ArcGIS Server (the maps that have their data source set in the database) and I can run python scripts that interact with the database in the python console in ArcMap. Yet, the same scripts, or even the smallest interactions (e.g. listing the feature classes with arcpy.ListFeatureClasses()
) does not work stand alone in python command line. I have tried both the 32 bit and 64 bit Python installations that came with the server and desktop and none run any smallest interactions with the geodatabase.
Any thoughts?
For reference, a small snippet of code that fails:
import arcpy
arcpy.env.workspace = 'path/connection.sde'
arcpy.ListFeatureClasses()
returns:
[]
python
). The interesting thing is that it only works in ArcMap's python window but the same python.exe that it runs is not able to run it. It makes me think that there is some environment variable or path not set properly but I have checked the environment variables withos.environ
against each other and there is no significant difference.