i want to use the Spatially constrained multivariate clustering tool for a point shapefile. I'm using PyScripter. The shapefile is named "LITO2016_area_modelli_20190312_v2" and the attribute fields i want to use in the analysis are "Rvmedian", "Rv_int_ran" and "zero". Prova is the output field. Arcpy give me this error:

AttributeError: 'module' object has no attribute 'SpatiallyConstrainedMultivariateClustering_stats'

I don't know where i'm wrong.

import arcpy
    from arcpy import env
    from arcpy.sa import *
    #Check out the ArcGIS Spatial Analyst extension license
    arcpy.env.workspace = r'C:\python'
    arcpy.SpatiallyConstrainedMultivariateClustering_stats("LITO2016_area_modelli_20190312_v2", "prova", None, "Rvmedian", "Rv_int_ran", "zero", None, None, None,"CONTIGUITY_EDGES_CORNERS")

Can anybody help me?

  • You imported say functions already, so use it without arcpy. Or use arcpy.sa, but no of arguments could be different – FelixIP Apr 15 '19 at 9:37

Seems like the correct name of the function is


In general, when you get an error: " 'module' object has no attribute X", it means that there is no function named X in the library/module/class, which means you probably have written something wrong in the name of the function, which should be quick to find in the corresponding module's documentation.

  • thnk you for your reply, it is well explained. I tried to change the name of the function like you suggest but it give the same error. – Elisa m Apr 15 '19 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.