Skip to main content
Question

Python Script will not run as Startup Script but runs in IDLE

  • September 13, 2017
  • 2 replies
  • 17 views

Hi All,

I have a python script that runs successfully in IDLE, but when I copy and paste the same script into the startup python script box in my workbench the script fails.

Below is the script:

 

# Import modules

 

import arcpy

 

import arcgisscripting

 

import arceditor

 

arcpy.env.overwriteOutput = True

 

arcpy.env.workspace = "C:\\Users\\GRAUP\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\Connection to NRGISSQLS03 WWW_GIS USER.sde\\www_gis.GIS_ADMIN.WastewaterDataset"# Local variables:

 

www_gis_GIS_ADMIN_RMoN_San_GravityMain = "C:\\Users\\GRAUP\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\Connection to NRGISSQLS03 WWW_GIS USER.sde\\\\www_gis.GIS_ADMIN.WastewaterDataset\\\\www_gis.GIS_ADMIN.RMoN_San_GravityMain"

 

RMoN_San_GravityMain_Route_Output = "H:\\\\O.10_Operating_Projects\\\\Linear_Referencing\\\\Reference\\\\Linear Referencing Shannon Working\\\\Linear_Referencing_Working.gdb\\\\RMoN_San_GravityMain_Route_sde_connection" # Process: Create Routes arcpy.CreateRoutes_lr(www_gis_GIS_ADMIN_RMoN_San_GravityMain, "GISOBJID", RMoN_San_GravityMain_Route_Output, "LENGTH", "", "", "UPPER_LEFT", "1", "0", "IGNORE", "INDEX")

 

Below is the error I get when trying to run in start-up in my workbench:

 

Python Exception <ExecuteError>: Failed to execute. Parameters are not valid.

ERROR 000732: Input Line Features: Dataset C:\\Users\\GRAUP\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\Connection to NRGISSQLS03 WWW_GIS USER.sde\\www_gis.GIS_ADMIN.WastewaterDataset\\www_gis.GIS_ADMIN.RMoN_San_GravityMain does not exist or is not supported

WARNING 000725: Output Route Feature Class: Dataset H:\\O.10_Operating_Projects\\Linear_Referencing\\Reference\\Linear Referencing Shannon Working\\Linear_Referencing_Working.gdb\\RMoN_San_GravityMain_Route_sde_connection already exists.

Failed to execute (CreateRoutes).

Wondering if anyone has experienced this issue before or has ideas to what the cause is.

Thanks.

2 replies

bruceharold
Contributor
Forum|alt.badge.img+17
  • Contributor
  • September 13, 2017

It may be the interpreter, is it Python 3? Try raw string:

www_gis_GIS_ADMIN_RMoN_San_GravityMain = r"C:\\Users\\GRAUP\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\Connection to NRGISSQLS03 WWW_GIS USER.sde\\\\www_gis.GIS_ADMIN.WastewaterDataset\\\\www_gis.GIS_ADMIN.RMoN_San_GravityMain"

"\\U" might look like unicode.


  • Author
  • September 14, 2017
bruceharold wrote:

It may be the interpreter, is it Python 3? Try raw string:

www_gis_GIS_ADMIN_RMoN_San_GravityMain = r"C:\\Users\\GRAUP\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\Connection to NRGISSQLS03 WWW_GIS USER.sde\\\\www_gis.GIS_ADMIN.WastewaterDataset\\\\www_gis.GIS_ADMIN.RMoN_San_GravityMain"

"\\U" might look like unicode.

I have a custom interpreter set up - the one with ESRI so that python can run the geoprocessing tools. I have ArcGIS 10.3.1 so the python interpreter is 2.7

 

Unfortunately raw string did not work, and the same error came up :( Thank you for the suggestion!

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings