AttributeError: Object: Tool or environment <FocalStatistics> not found

531
4
Jump to solution
03-19-2023 05:44 PM
Labels (2)
GregAO
by
New Contributor II

Hi, I'm using ArcGIS Pro 2.9 and have a python version 2 script written with ArcMap 10.3.

The script bombs out on the following line:

arcpy.gp.FocalStatistics(inputFC, outFileName, inExpression, "MEAN", "DATA")

with the error: Object: Tool or environment <FocalStatistics> not found.

Does "arcpy.gp" NOT exist any more? I realize there is focal statistics in arcpy.sa. Is that the only one I can use, it doesn't allow an output file raster to be specified.

Greg.

0 Kudos
1 Solution

Accepted Solutions
GregAO
by
New Contributor II

Thanks Dan.

I was hoping there was an equivalent to arcpy.gp in Arc Pro, but evidently not.

 

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Focal Statistics (Spatial Analyst)—ArcGIS Pro | Documentation

you save it after

# --
from arcpy.sa import *
outFocalStatistics = FocalStatistics(......
outFocalStatistics.save("C:.....

or
outFocalStatistics = arcpy.sa.FocalStatistics(......
outFocalStatistics.save("C:.....

... sort of retired...
0 Kudos
GregAO
by
New Contributor II

Thanks Dan.

I was hoping there was an equivalent to arcpy.gp in Arc Pro, but evidently not.

 

0 Kudos
SteveLynch
Esri Regular Contributor

...or

arcpy.gp.focalstatistics_sa(inputFC, outFileName,...

0 Kudos
GregAO
by
New Contributor II

Ahaaaa, Thanks.

0 Kudos