Closed lenhsherr closed 7 years ago
try this
jupyter-nbextension enable nglview --py --sys-prefix
On a fresh install on I am not sure if it is the same issue (JS console does not say anything) but the terminal from which the nb was started says
[W 11:39:47.413 NotebookApp] 404 GET /nbextensions/nglview.js?v=20170928113941 (::1) 2.16ms referer=http://localhost:8888/notebooks/Figure_summary.ipynb
[W 11:39:47.588 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20170928113941 (::1) 2.07ms referer=http://localhost:8888/notebooks/Figure_summary.ipynb
I'm on Linux w Debian Stretch have enabled the nbtextensions and
ipywidgets 7.0.0 py36h7b55c3a_0 https://repo.continuum.io/pkgs/main
nglview 1.0b2 <pip>
widgetsnbextension 3.0.2 py36hd01bb71_1 https://repo.continuum.io/pkgs/main
Debugging a non instantiated widget is the hardest thing to do with nglview....
Okay, the 404 thing was unrelated, but still cannot instantiate....and the error is the same as above, any pointers will be appreciated
so does the ipywidgets work?
import ipywidgets
ipywidgets.Text("hello")
yeah that works no problem
"Class NGLModel not found in module nglview-js-widgets"
mean: the nglview-js-widgets
is still the old version. We do have that here: https://github.com/arose/nglview/blob/v1.0.b2/js/src/widget_ngl.js#L17
Not sure why.
I've tried above with new conda nev
conda create -n debug_nglview python=3.6 numpy
source activate debug_nglview
pip install nglview==1.0b2
nglview enable # same as: jupyter-nbextension enable nglview --py --sys-prefix
jupyter nbextension enable --py --sys-prefix widgetsnbextension # enable ipywidgets since we installed via pip
jupyter notebook
sooo....anything I can do on my side? TBH, getting nglview to work is always a bit of mystery to me
getting nglview to work is always a bit of mystery to me
welcome to club. That's the way ipywidgets works.
yes...but, you don't have any other pointers? I don't really understand what you mean with this comment https://github.com/arose/nglview/issues/696#issuecomment-332837466
It meant that nglview-js-widgets supposed to have "NGLModel" but you don't have that. The NGLModel is introduced recently.
sooo....anything I can do on my side?
Uninstall nglview and its JS components and
pip install nglview==1.0.b2
nglview enable
PS: Per uninstall, besides pip uninstall nglview
(do it several times) or (conda uninstall nglview),
would be safer to delete the folder miniconda3/share/jupyter/nbextensions/nglview-js-widgets
(or similar path).
yeah I've been doing install/remove/reinstall (via conda and pip) very often, still cannot get it to work. Will do and report back. What do you mean to unintall the JS component of nglview...does it not unisntall itself?
does it not unisntall itself?
I have no idea. Normally it will be overwritten by installing new nglview version. Just be sure.
Depending on how you activate the nglview-js-widgets
and your path, you can try to find it via
cd $HOME
find . -name nglview-js-widgets
Ideally, that folder should be in miniconda{version}/shared/jupyter/nbextensions/
got it, it think. This guy seems to be the culprit: ./.local/share/jupyter/nbextensions/nglview-js-widgets/
It would be really helpful to have a trouble-shooting/FAH section on your page. Like, things to try if the widget is not being shown
Yeah, we ar a bit lazy now. Welcome to contribute anything. In worse case, just open issue here.
On Thu, Sep 28, 2017 at 10:34 AM Guillermo Pérez-Hernández < notifications@github.com> wrote:
got it, it think. This guy seems to be the culprit: ./.local/share/jupyter/nbextensions/nglview-js-widgets/
It would be really helpful to have a trouble-shooting/FAH section on your page. Like, things to try if the widget is not being shown
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arose/nglview/issues/696#issuecomment-332856056, or mute the thread https://github.com/notifications/unsubscribe-auth/AEPuddyujaYyhPmhM1JN7vqmxSAqIHCNks5sm66GgaJpZM4PmH22 .
Thanks, I'm able to fix it with jupyter-nbextension enable nglview --py --sys-prefix
There seems to be two command in the tutorial for enabling the widget:
jupyter-nbextension enable nglview --py --sys-prefix jupyter nbextension enable nglview --py --sys-prefix
It seems for <1.0 only the second one works, but for 1.0 only the first one, although it could just be me. Whats the difference here?
I think they are thgoing same.
On Thu, Sep 28, 2017 at 10:54 AM Haotian notifications@github.com wrote:
Thanks, I'm able to fix it with jupyter-nbextension enable nglview --py --sys-prefix
There seems to be two command in the tutorial for enabling the widget:
jupyter-nbextension enable nglview --py --sys-prefix jupyter nbextension enable nglview --py --sys-prefix
It seems for <1.0 only the second one works, but for 1.0 only the first one, although it could just be me. Whats the difference here?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arose/nglview/issues/696#issuecomment-332862339, or mute the thread https://github.com/notifications/unsubscribe-auth/AEPudbmvrR28vhhiIGkwSQvLOAhE4ZB1ks5sm7MKgaJpZM4PmH22 .
enjoy, guys.
@gph82 so I am collection FAQ here: https://github.com/arose/nglview/blob/master/docs/FAQ.md
I can also confirm that the ~/.local/share/jupyter/nbextension/nglview-js-widgets containing an old (pip install) made everthing fail. Does the this directory has a higher preference over sys-prefix? I would be worth adding it to the FAQ.
Does the this directory has a higher preference over sys-prefix?
Yes
and thanks, will update FAQ. After 1.0, there won't be any issue like that anymore. For now, please just delete the ~/.local/share/jupyter/nbextension/nglview-js-widgets folder.
Hai
On Mon, Dec 4, 2017 at 11:16 AM, Martin K. Scherer <notifications@github.com
wrote:
I can also confirm that the ~/.local/share/jupyter/nbextension/nglview-js-widgets containing an old (pip install) made everthing fail. Does the this directory has a higher preference over sys-prefix? I would be worth adding it to the FAQ.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/arose/nglview/issues/696#issuecomment-349012281, or mute the thread https://github.com/notifications/unsubscribe-auth/AEPudcYSVFu2dh9tvmfcX814qSYGd_bqks5s9BrjgaJpZM4PmH22 .
update FAQ here, hopefully it's clear: https://github.com/arose/nglview/blob/master/docs/FAQ.md
Hi, I'm testing a script on two Macs, and despite apparently identical setup, the widget does not show up on only one of them.
Javascript control panel shows this. `[Error] Could not instantiate widget [Error] Error: Could not create a model. — utils.js:109 [Error] Couldn't process kernel message – "Class NGLModel not found in module nglview-js-widgets" [Error] Unhandled Promise Rejection: Class NGLModel not found in module nglview-js-widgets'
What does this mean?
1.0.b2 nglview 7.0.0 ipywidgets