I was developing a number of stand-alone Python scripts last couple of days and were working perfectly.
Today, I updated the ArcGIS Pro to the new version (2.8.0) and the scripts do not work anymore. Whenever I try to execute them, I get the following message:
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 120, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\__init__.py", line 18, in <module>
from .Raster import Raster
ModuleNotFoundError: No module named 'arcpy.sa.Raster'
I navigated to the aforementioned path in order to find the Raster.py file but it was not there.
Could you, please, help me with this?
Thank you in advance.
it is there.
Did you do a clean install? An install from the downloaded *.exe (or *.msi)? Or did you update through Pro?
import arcpy.sa.Raster as R dir(R) ['RAT', ... snip 'addDimension', 'appendSlices', 'bandCount', 'bandNames', 'bands', 'blockSize', 'catalogPath', 'compressionType', 'exportImage', 'extent', ...snip 'setVariableAttributes', 'slices', 'spatialReference', 'standardDeviation', 'uncompressedSize', 'variableNames', 'variables', 'width', 'write']
Hi @DanPatterson and thank you for your reply.
The Raster.py is not in the directory that you mentioned.
I didn't do a clean install and didn't use an exe file for the update.
The update was applied through the ArcGIS Pro GUI.
Don't know. I always do a clean install from the *.exe to get the *.msi and the *.cab, so I have a copy and don't need to re-download.
I always find clean installs save me the most time... a little house tidying is usually in order between versions.