Hello all,
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>
import arcpy.sa
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.
C:\...YourInstallFolder...\Resources\ArcPy\arcpy\sa\Raster.py
it is there.
Did you do a clean install? An install from the downloaded *.exe (or *.msi)? Or did you update through Pro?
through python
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.
Any thoughts?
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.
I was curious if this was widespread, so I checked mine. I upgraded to 2.8 through the Pro GUI and I still see the Raster.py in my folder.
I have downloaded the .exe file and applied a Repair Install.
I am good to go, now. Everything runs perfectly.
@DanPatterson @ChelseaRozek thank you so much for your inputs!