gis.map() displays text, not a map

2072
9
Jump to solution
12-19-2017 09:35 AM
JasonCarter
New Contributor III

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

0 Kudos
1 Solution

Accepted Solutions
DavidVitale
New Contributor III

Jason CarterEric 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

View solution in original post

9 Replies
DanPatterson_Retired
MVP Esteemed Contributor
0 Kudos
JasonCarter
New Contributor III

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?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

if you have something to map... like a basemap or a point as in my 3rd example... (In [19]: line 3 )

0 Kudos
JasonCarter
New Contributor III

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.

 

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

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)

0 Kudos
Ericvan_Rees
New Contributor

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. 

0 Kudos
JasonCarter
New Contributor III

Interesting... perhaps this is a release issue?

0 Kudos
DavidVitale
New Contributor III

Jason CarterEric 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

JasonCarter
New Contributor III

Thank you very much.

0 Kudos