I am working on a script in PyCharm. When I run my set up lines:
import arcpy, os
from arcpy import env
from arcpy.management import Delete, Rename, Copy, CreateFileGDB, CalculateGeometryAttributes
I get the following error:
ImportError: cannot import name CalculateGeometryAttributes
I need the CalculateGeometryAttributes tool in the last step of the script, and my code was working fine before I added it in. I was able to import and use Delete, Rename, Copy, and CreateFileGDB from the Management toolbox without issue.
I can't figure out what I'm doing wrong here and why this tool in particular is not able to import. Any help would be appreciated!
Solved! Go to Solution.
Thank you both for your ideas, I still was unable to resolve and ended up deciding to just use an update cursor instead, which is working nicely.
Works for me... version of Pro?
from arcpy.management import CalculateGeometryAttributes
help(CalculateGeometryAttributes)
Help on function CalculateGeometryAttributes in module arcpy.management:
CalculateGeometryAttributes(in_features=None, geometry_property=None, length_unit=None, area_unit=None, coordinate_system=None, coordinate_format=None)
CalculateGeometryAttributes_management(in_features, geometry_property;geometry_property..., {length_unit}, {area_unit}, {coordinate_system}, {coordinate_format})
... snip ...
Also check to see if you have this folder and it has files
C:\...Your_Install_folder...\Resources\ArcToolBox\toolboxes\Data Management Tools.tbx\CalculateGeometryAttributes.tool
Thank you both for your ideas, I still was unable to resolve and ended up deciding to just use an update cursor instead, which is working nicely.