pbugnion / gmaps

Google maps for Jupyter notebooks
https://jupyter-gmaps.readthedocs.io/en/stable/
Other
760 stars 146 forks source link

Failed to display Jupyter Widget of type Figure. #207

Closed Stazzy1 closed 6 years ago

Stazzy1 commented 7 years ago

I'm trying to display a map in my jupyter notebook, however I am getting this error when running the cell. I followed the setup closely although there is something just not adding up.. I'm new to python and tried to follow a couple of the other threads similar to this although still no joy. I have (hopefully) attached the image below of how my console looks. Any help would be greatly appreciated

image

image

pbugnion commented 7 years ago

Thanks for raising this. To isolate the problem, it would be useful to know if the issue is with gmaps itself, or with your installation of ipywidgets.

Do the following lines work?

import ipywidgets as widgets
widgets.IntSlider()
Stazzy1 commented 7 years ago

Hey, so I tried to run these lines and I have got this message. I guess it is my installation

image

pbugnion commented 7 years ago

Great, that helps. Jupyter widgets can be a bit fiddly to install.

If you type jupyter nbextension list in the terminal, what's the full output?

Stazzy1 commented 7 years ago

This is my output

image

pbugnion commented 7 years ago

It looks like you have two conflicting installations of the Javascript part of both Jupyter widgets and gmaps (ie jupyter-js-widgets and jupyter-gmaps appear twice in that list). You should only see extensions appear once.

If I were in your position, I would:

conda install -c conda-forge gmaps

Or

pip install -U gmaps
jupyter nbextension enable --py --sys-prefix widgetsnbextension
jupyter nbextension enable --py --sys-prefix gmaps

If you can, I recommend conda -- there's much less scope for things going wrong.

Stazzy1 commented 7 years ago

Hey,

I'm very sorry I'm quite new to this and I'm not sure if I have correctly uninstalled these packages.

image

The above image is what I have at the moment. I wasn't sure whether this was the expected output? Which extension is the orphaned one?

Stazzy1 commented 7 years ago

I fiddled a bit more and now have this :

image

I also tried to re-edit the json folder and this was my output: (I have changed it back to how it was before now though.)

image

pbugnion commented 7 years ago

I fiddled a bit more and now have this

Both versions of the extensions are still enabled, but they now look broken.

I also tried to re-edit the json folder

It looks like your configuration is now invalid JSON. You are missing a comma on line 3.

Stazzy1 commented 7 years ago

This is now my output, however issue is persisting..

image

pbugnion commented 7 years ago

Did you run through all 4 bullet points? After uninstalling, the extension that you are left with is the one that's causing issues.

You need to go into /usr/share/jupyter/nbextensions and remove the remaining jupyter-js-widgets and jupyter-gmaps directories. You should only try re-installing when jupyter nbextension list returns nothing.

pbugnion commented 6 years ago

Closing. Feel free to reopen if you have further issues.