ImportError: cannot import name 'Raster' from 'arcgis.raster'

687
2
Jump to solution
05-03-2020 02:14 AM
AndreyKorotkov
New Contributor

Hello,

I am using arcgis 1.7.1 module in my local Python 3.7 environment. 

On the following statement:

      from arcgis.raster import Raster

I got import error:

   ImportError: cannot import name 'Raster' from 'arcgis.raster' (/Users/andy/opt/anaconda3/lib/python3.7/site-packages/arcgis/raster/__init__.py)

Is it error related to Raster add-on licence?  My account is restricted to ArcGIS Online.    

Regards,

Andrey Korotkov

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Esteemed Contributor
import arcgis
from arcgis.raster import Raster

arcgis.__version__
'1.8.0'

dir(Raster)
['__abs__', '__add__', '__and__', '__class__', ... snip ...‍‍‍‍‍‍‍‍

arcgis.raster module — arcgis 1.8.0 documentation 

which indicates

Use arcgis.raster.analytics.is_supported(gis) to check if raster analysis is supported in your GIS.

check with an active 'gis' environment

I don't think it changed from version 1.7.1

View solution in original post

0 Kudos
2 Replies
DanPatterson_Retired
MVP Esteemed Contributor
import arcgis
from arcgis.raster import Raster

arcgis.__version__
'1.8.0'

dir(Raster)
['__abs__', '__add__', '__and__', '__class__', ... snip ...‍‍‍‍‍‍‍‍

arcgis.raster module — arcgis 1.8.0 documentation 

which indicates

Use arcgis.raster.analytics.is_supported(gis) to check if raster analysis is supported in your GIS.

check with an active 'gis' environment

I don't think it changed from version 1.7.1

0 Kudos
AndreyKorotkov
New Contributor

Thank you, Dan

I have reinstalled arcgis to 1.8.0. Corrected. Possibly, my 1.7.1 installation was incomlete.

0 Kudos