Select to view content in your preferred language

Toolbox Python script problem : arcgisscripting.ExecuteError

626
1
Jump to solution
09-25-2023 08:11 AM
Labels (1)
ChloéV
New Contributor

Hi everyone !

I've started to code a new toolbox with python scripts. All tools are from arcpy : it's just a sequence of arcgis functions.

For instance, first step, I want to create a slope raster. So I call the function SurfaceParameters.

I've imported the function like that :

from arcpy.ra import SurfaceParameters as SurfaceParameters_ra

If I do it as described (from .ra import SurfaceParameters as SurfaceParameters_ra), I get this error message : "ImportError: attempted relative import with no known parent package". But I think I've found a solution (but not sure ?), by importing as above.

Then, I simply create a slope raster by using SurfaceParameters, and I copy this raster in a new raster layer :

ChloPauletteVALENTI_0-1695653616461.png

Finally, I get this error :

ChloPauletteVALENTI_1-1695653775559.png

I try to understand where is the error, but I'm tying myself into knots right now!

I hope someone could help me, and I am really sorry if my request is quite idiot...

Sorry for my english too.

Best regards from France.

Chloe

 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

If you are working locally why not use

Surface Parameters (Spatial Analyst)—ArcGIS Pro | Documentation

because the one you are using from ra is against portal and expects...

outputRasterName (String):
The name of the output raster service.

whereas you just provided a name


... sort of retired...

View solution in original post

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

If you are working locally why not use

Surface Parameters (Spatial Analyst)—ArcGIS Pro | Documentation

because the one you are using from ra is against portal and expects...

outputRasterName (String):
The name of the output raster service.

whereas you just provided a name


... sort of retired...
0 Kudos