Hi,
Just getting started with the Python API. Testing out my first Jupyter notebook and I am unable to see a map.
I'm running Conda v 4.3.31 and Jupyter 4.3.0.
When I load the arcgis module and run the command
gis.map() the notebook just returns text that says, "A Jupyter Widget"
I made sure ipywidgets is installed and I ran the following command, but I still get the text rather than the map.
jupyter nbextension enable --py widgetsnbextension
What can I do to solve this?
Thank you
Solved! Go to Solution.
Jason Carter Eric van Rees Thanks for documenting your issue, sorry the Python API isn't working for you. I have seen similar map widget errors before, they are normally related to the dependencies that the python API uses. Jason, I was able to reproduce your issue by creating a test environment with jupyter 4.3.0 and arcgis python api 1.3. I believe v1.3 of the API needs a more recent jupyter notebook dependency: we have an ipywidgets >5.2.2,<7 requirement.
Could both of you create a new blank conda environment and install the API through that environment? This will guarantee you have all the right dependencies. You can do that by running these commands:
conda create --name new_blank_env_name
activate new_blank_env_name
conda install -c esri arcgis -y
jupyter notebook
(If you're using an OSX/Linux machine, please use the "source activate new_blank_env_name" command instead.)
Let me know if running the above commands do not fix the issue, or any other problems you have. I'm happy to help both of you resolve this issue!
- David
The api reference is here
http://esri.github.io/arcgis-python-api/apidoc/html/
be careful there is little gis and big GIS.
some blogs posts
ArcGIS API for Python... What is where
Hi,
Thank you for your response. I should have posted my full code. '
from arcgis.gis import GIS
gis - GIS()
gis.map()
output text:
"A Jupyter Widget"
Shouldn't I be seeing a map here?
if you have something to map... like a basemap or a point as in my 3rd example... (In [19]: line 3 )
My notebook looks exactly like this:
Install and set up | ArcGIS for Developers
Except where there is a map image in the above link, my notebook displays a text string "A Jupyter Widget" (See image below). This makes me question if there is something wrong with my jupyter configuration? This is the question I am asking. Adding coordinates does not change my output.
I would presume so, but I assumed you are logged and have even tried the examples in the api documentation?
https://developers.arcgis.com/python/guide/using-the-gis/
I can't help, since it hasn't not work, so I presume it is because of installation or there is nothing to connect to ( ie ArcGIS online perhaps)
A new version of the API was released today (v. 1.3). I guess that has something to do with the problem (that I experienced myself too today). I upgraded to the latest version and tried a lower version, but could not display the map in both instances.
Interesting... perhaps this is a release issue?
Jason Carter Eric van Rees Thanks for documenting your issue, sorry the Python API isn't working for you. I have seen similar map widget errors before, they are normally related to the dependencies that the python API uses. Jason, I was able to reproduce your issue by creating a test environment with jupyter 4.3.0 and arcgis python api 1.3. I believe v1.3 of the API needs a more recent jupyter notebook dependency: we have an ipywidgets >5.2.2,<7 requirement.
Could both of you create a new blank conda environment and install the API through that environment? This will guarantee you have all the right dependencies. You can do that by running these commands:
conda create --name new_blank_env_name
activate new_blank_env_name
conda install -c esri arcgis -y
jupyter notebook
(If you're using an OSX/Linux machine, please use the "source activate new_blank_env_name" command instead.)
Let me know if running the above commands do not fix the issue, or any other problems you have. I'm happy to help both of you resolve this issue!
- David
Thank you very much.