Esri / arcgis-python-api

Documentation and samples for ArcGIS API for Python
https://developers.arcgis.com/python/
Apache License 2.0
1.9k stars 1.11k forks source link

Unable to get arcgis.mapping to work #2149

Closed gv2325 closed 3 weeks ago

gv2325 commented 3 weeks ago

Describe the bug Unable to use the arcgis mapping module

error:

Import Error: Cannot import WebMap from arcgis.mapping

Screenshots

Screenshot 2024-10-29 at 2 30 09 PM

Platform (please complete the following information):

Additional context I used the docker availble on the repo, the same is reproducible if using it in a conda environment or on Google Colab with !pip install arcgis

achapkowski commented 3 weeks ago

You need to install Arcgis-mapping.

See: https://developers.arcgis.com/python/latest/guide/install-and-set-up/anaconda/

gv2325 commented 3 weeks ago

is the recommendation to create an entirely new environment for arcgis 2.4.0? also is the docker container i used not correct? hoping to point users there to get the right environment for 2i2c

achapkowski commented 3 weeks ago

Did you try using this? https://github.com/Esri/arcgis-python-api/blob/master/docker/NotebookImage.Dockerfile

jtroe commented 3 weeks ago

@gv2325 please see the updated documentation for v2.4.0 on using the map widget at developers.arcgis.com/python


The arcgis.mapping namespace has been deprecated in v2.4.0 and we have released a new Jupyter Lab based package to provide the widgets. You will now use the arcgis.map namespace for mapping widgets. An even simpler way of accessing this is to just call .map() on your GIS object.

image

If you wish to interact directly, you may use:

image

Please make sure your docker image is up to date. Thank you!

gv2325 commented 3 weeks ago

Hi @jtroe and @achapkowski,

Thanks for the update, I just went through the whats new in 2.4.0 and have understood what the refactor does. I have switched to using an environment.yml for binder but stil getting errors on Google Colab. Thanks again!

jtroe commented 3 weeks ago

@gv2325 please open a separate issue for Colab. With environment details for it.