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

witwidget doesn't display in jupyter notebook #188

Open
KimmyHarry opened this issue Nov 8, 2021 · 7 comments
Open

witwidget doesn't display in jupyter notebook #188

KimmyHarry opened this issue Nov 8, 2021 · 7 comments

Comments

@KimmyHarry
Copy link

Hello, When i run the example -
WIT_Model_Comparison.ipynb

inside my jupyter notebook in Anaconda, I can't see any widget.

But the notebook shows that widget is already installed.
7

@jameswex
Copy link
Collaborator

jameswex commented Nov 8, 2021

Can you try adding an a.render()call after you create your widget? I believe in colab the widget will render upon construction, but in Jupyter you must either call the render method on the widget, or return the widget itself in the notebook cell (by just having another line in that cell, or a different cell that just contains a).

@KimmyHarry
Copy link
Author

Can you try adding an a.render()call after you create your widget? I believe in colab the widget will render upon construction, but in Jupyter you must either call the render method on the widget, or return the widget itself in the notebook cell (by just having another line in that cell, or a different cell that just contains a).

Thank you very much for your answer. But after adding an 'a.render()'call ,I still can't see the widget.
I wonder if this has something to do with the fact that I didn't import Google.colab.

@jameswex
Copy link
Collaborator

jameswex commented Nov 8, 2021

What version of Jupyter are you using? Have you followed the install steps in the readme in https://github.com/pair-code/what-if-tool ?

@KimmyHarry
Copy link
Author

Yes, I have followed the tutorial. And my version is 6.3. But I am not running the three lines of pip code in jupyter notebook, but the command running in cmd, will this have any effect?

What version of Jupyter are you using? Have you followed the install steps in the readme in https://github.com/pair-code/what-if-tool ?

@jameswex
Copy link
Collaborator

jameswex commented Nov 8, 2021

Running those lines in the console (only need to one time, when first installed) before launching your jupyter kernel should work.

Perhaps you could try an older version of Jupyter, or using JupyterLab versions 1, 2, or 3? It's possible the widget has issues in later versions of classic Jupyter.

@KimmyHarry
Copy link
Author

Thank you a lot, I will try it.

In addition, I found the following error when I entered the program today. May I ask whether this error indicates that I did not install successfully.
187582221470228484

@jameswex
Copy link
Collaborator

If you are just opening a notebook that previously rendered the widget, I don't think that error signifies any specific install issue. The rendering won't persist between openings of a notebook. You would need to re-run the cell to re-render the UI upon opening the notebook again. Any luck with different Jupyter versions?

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