Hi,
I'm trying to add an image service to a map. I'm following documentation (https://developers.arcgis.com/python/latest/guide/using-imagery-layers/) that says to use the arcgis.layers module, but I get the following error: ModuleNotFoundError: No module named 'arcgis.layers'
I'm using ArcGIS Pro 3.2, I cloned and updated the active environment...still not found. Any suggestions would be appreciated.
Thanks.
Hey all,
I ran into the same problem using ArcGIS PRO 3.3.5 (arcgis 2.3.0.4) and this two import variants:
import arcgis.layers from arcgis import layers
It seems that the arcgis.layers module is simply not part of this arcgis version?
It's just not mentioned in the documentation [1], which is a bit problematic.
In the OGC examples [2], a different approach is mentioned, but this does not work with this version either.
from arcgis.mapping.layers import WMTSLayer, WMSLayer
[1] https://developers.arcgis.com/python/latest/api-reference/arcgis.layers.toc.html
[2] https://developers.arcgis.com/python/latest/samples/publish-ogc-services/#connect-to-your-gis
regards,Hannes
its npt retired ... I am
so you are aren't using Pro 3.4 and python 3.11 and the cloning of the environment wouldn't have installed the correct version of the arcgis module, and even if you did install it, you will have to check that is the correct version in the clone
Thanks @DanPatterson. That still didn't work. If it's retired, is there a new (or different) way of adding an image web service?
arcgis 2.4 requires python >3.10 .13
doesn't Pro 3.2 use 3.9?
give this a try
import arcgis arcgis.__version__ '2.4.0' from arcgis import layers dir(layers) ['BasemapService', 'BasemapServices', 'BuildingLayer', 'CSVLayer', 'EnterpriseMapImageLayerManager', 'EnterpriseSceneLayerManager', 'EnterpriseVectorTileLayerManager', .... snip ...
maybe the clone installed a different versin and "layers" is now a separate module
Yes, @CodyPatterson that's what is causing the error I'm receiving. Sorry, I should have made that more clear...
Hey @tad
Are you importing the arcgis.layers module?
Cody
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.