I am running a similar program from my local computer's terminal and from an AWS EC2.
They both start with:
from arcgis.gis import *
from arcgis.mapping import WebMap
From my local computer, the code continues past the import and runs fine.
From the AWS EC2, I get the following error:
from arcgis.mapping import WebMap
ImportError: cannot import name 'WebMap' from 'arcgis.mapping' (/home/ec2-user/miniconda3/envs/env2/lib/python3.12/site-packages/arcgis/mapping/__init__.py)
I am running an Anaconda terminal locally and miniconda in my EC2.
I used "conda install -c esri arcgis" in both.
Any idea why this is happening and how to fix it?
Thanks
I think I have found the issue. The working environment is running arcgis 2.3.1 and the non-working one is running 2.4.0. From here https://www.esri.com/arcgis-blog/products/api-python/announcements/whats-new-in-arcgis-api-for-pytho... it appears that "The previous arcgis.mapping and arcgis.widgets modules have been deprecated and refactored into the new arcgis.map module." I have not tested yet, but this sounds like it could be the cause of the error.