Unable to connect to "Database Connections/.sde" from python

المشرف العام

Administrator
طاقم الإدارة
I just upgraded to 10.3.1 and now I am having issues running my administrative tasks set with Python scripts.

I am unable to use the string "Database Connections/some.sde", i.e:

arcpy.ListUsers("Database Connections/some.sde) Returns the following error:

Traceback (most recent call last): File "", line 1, in userList = arcpy.ListUsers("Database Connections/some.sde") File "C:\Program Files\ArcGIS\Server\ArcPy\arcpy\__init__.py", line 1058, in ListUsers return utils.listofnamedtuples(gp.listUsers(sde_workspace), 'user') File "C:\Program Files\ArcGIS\Server\ArcPy\arcpy\geoprocessing\_base.py", line 504, in return lambda *args: val(*gp_fixargs(args, True)) TypeError: Could not open SDE workspace.

I can use the full path string for some tasks like ListUsers, AcceptConnections,etc., but not others like reconcile and post, e.g.:

"C:\Users\%username%\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\some.sde"

Fails without throwing error at: arcpy.ReconcileVersions_management("C:\Users\%username%\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\some.sde","ALL_VERSIONS","DBO.QC","DBO.Chris;DBO.Joe","LOCK_ACQUIRED","NO_ABORT","BY_OBJECT","FAVOR_EDIT_VERSION","POST","KEEP_VERSION","#")

The full script is here, which worked great prior to 10.3 upgrade: reconcile and post script

In ArcCatalog I have created these database connections, they work fine, I can browse in Catolog, and the .sde files exist in my AppData/Roaming/ESRI subdirectory. I have tried copying all my old connection strings from the 10.2 into my roaming profile. Is there some environmental variable that needs to be repaired? Do I need to re-install Server and Desktop on this machine?

Question: How can I repair my "Database Connections" to run Python scripts



أكثر...
 
أعلى