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.
For reference, a small snippet of code that fails:
import arcpy arcpy.env.workspace = 'path/connection.sde' arcpy.ListFeatureClasses()