Hey,
when I am using .ags file with ArcGIS Pro I can e.g. run this function via Notebook/PythonWindow:
https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listdatastoreitems.htm
However, when I am running standalone script, I am receiving:
RuntimeError: Cannot open AGS Server connection.
This is stand-alone AGS server.
Any ideas?
Regards,
Yanu
How are you running the script exactly? Is it running from the same machine with the same user credentials?
Seems like you've got some sort of error in how you're passing the connection file to the function. You're using the correct environment since the error is related to the AGS connection and not the arcpy import, but the connection is failing in the standalone. Mind sharing the ListDataStoreItems call that's failing?
Exactly the same user, there is no issue with the license. I guess ArcGISPro is setting some additional params...
My code is
import arcpy
ags_file = 'path_tofile.ags'
print(arcpy.ListDataStoreItems(ags_file, "DATABASE"))
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.