Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to display Jupyter Widget of type Figure. #207

Closed
Stazzy1 opened this issue Nov 25, 2017 · 11 comments
Closed

Failed to display Jupyter Widget of type Figure. #207

Stazzy1 opened this issue Nov 25, 2017 · 11 comments

Comments

@Stazzy1
Copy link

Stazzy1 commented Nov 25, 2017

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
Copy link
Owner

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
Copy link
Author

Stazzy1 commented Nov 25, 2017

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

image

@pbugnion
Copy link
Owner

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
Copy link
Author

Stazzy1 commented Nov 25, 2017

This is my output

image

@pbugnion
Copy link
Owner

pbugnion commented Nov 26, 2017

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:

  • uninstall both gmaps and ipywidgets (using pip or conda or however you installed them)
  • run jupyter nbextension list again. You should hopefully see a single version of jupyter-js-widgets and jupyter-gmaps. This orphaned extension is what's causing problems.
  • Remove this orphaned extension. The easiest is probably to edit the notebook.json file in the relevant config directory. You may also want to remove the actual source if it's still there. You can usually get there by just replacing /etc/ by /share/ in the path to the config. If not, run jupyter --paths and look into the data section.
  • Run jupyter nbextension list. You should hopefully see no trace of either jupyter-js-widgets or jupyter-gmaps.
  • Install again, either by running:
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
Copy link
Author

Stazzy1 commented Nov 26, 2017

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
Copy link
Author

Stazzy1 commented Nov 26, 2017

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
Copy link
Owner

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
Copy link
Author

Stazzy1 commented Nov 27, 2017

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

image

@pbugnion
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants