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

Getting Nglview going in Kaggle platform #947

Closed
phu004 opened this issue Feb 8, 2021 · 7 comments
Closed

Getting Nglview going in Kaggle platform #947

phu004 opened this issue Feb 8, 2021 · 7 comments

Comments

@phu004
Copy link

phu004 commented Feb 8, 2021

I am trying to get nglview going using Kaggle platform.

This is my installation code:
python -m pip install git+https://github.com/arose/nglview
jupyter nbextension enable --py widgetsnbextension

However when I try to run ngview, i.e.
import nglview
view = nglview.show_pdbid("3pqr")
view

It only output the message "NGLWidget()" without showing any window or error.

Can anyone suggest what I might be doing wrong?

nglview: 2.7.7
ipywidgets: 7.6.2

browser console error track:

manager-base.js:273 Could not instantiate widget
utils.js:119 Error: Could not create a model.
at utils.js:119

Thanks in Advance!

Pan

@hainm
Copy link
Collaborator

hainm commented Feb 9, 2021

Try to enable nglview too: jupyter-nbextension enable nglview --py --sys-prefix

@phu004
Copy link
Author

phu004 commented Feb 10, 2021

I have tried that as well, unfortunately I am still getting the same error.

@hainm
Copy link
Collaborator

hainm commented Feb 10, 2021

@phu004 Can you make the ipywdgets work?

import ipywidgets as Text
Text("HELLO")

If that does not work, I don't think your platform support it.
Similar issue: #816

@phu004
Copy link
Author

phu004 commented Feb 10, 2021

Thanks for replying, I got the following from executing Text("HELLO")

TypeError Traceback (most recent call last)
in
1 import ipywidgets as Text
----> 2 Text("HELLO")

TypeError: 'module' object is not callable

However executing Text.IntSlider() works

@hainm
Copy link
Collaborator

hainm commented Feb 10, 2021

import ipywidgets as Text

My bad. import ipywidets; ipywidgets.Text("hello")

However executing Text.IntSlider() works

Did you kill/close your notebook and reopen the session after enabling nglview?

@phu004
Copy link
Author

phu004 commented Feb 10, 2021

In kaggle, if you close the notebook session, any change you have made to the kernel (such as installed packages) are lost.

So what I did is starting a fresh notebook instance and re-do all the steps plus the "enable" line. But it doesn't seem to make any difference.

@hainm
Copy link
Collaborator

hainm commented Feb 10, 2021

Then I am sorry not able to help. I am not familiar with the platform.

@hainm hainm closed this as completed Apr 1, 2021
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