-
Notifications
You must be signed in to change notification settings - Fork 306
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
nglview not working with vscode-jupyter #15757
Comments
Same issue for me |
There seems to be some change in nglview that seems to be causing this issue in VS code. |
@DonJayamanne I tried it with 2.7.7 and get the same outcome. Maybe this trace helps (is from 3.1.2 nglview though)
|
same issue here |
Helo, I have the same problem in VSC, please someone found a solution? Thanks |
@DonJayamanne I tried many different versions and got version 3.0.8 (installed via conda conda-forge::nglview=3.0.8) to work with VScode on linux version 1.91.1 Hope this helps |
This seems to be caused by some upstream issue in nglview, I haven't had a chance to identify the root cause as of yet. |
There is a change in NGL (which is being used by nglview) in the way it is packaged. The change happened after nglview 3.8. But nglview works fine with notebook (using lab) and lab. |
@hainm its still failing at my end in Jupyter lab |
Can you please try install nglview via conda/mamba from conda-forget channel? I am surprised that it doesn't work for you since I tried myself before publishing the package. Cheers |
@DonJayamanne
Exact steps:
|
There is the same problem for Bokeh/ Panel. See bokeh/jupyter_bokeh#201 |
This comment was marked as off-topic.
This comment was marked as off-topic.
@invemichele You are running into #16008 |
Seems like this issue still there. Any new ideas and/or suggestions on how to fix this in the VS code? |
I am also still experiencing this issue, too! |
Same issue for me as well. |
I can confirm when using |
Work aroundDowngrad to |
@DonJayamanne I don't think two issues you quoted relate to this issue. Nglview is still working fine in jupyterlab. So it makes sense it should work in vscode too? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi,
Yes, it’s coincidence and it might the cause.
3.0.8 works for both vscode and jupyterlab
3.0.10 works for jupyterlab but not for vscode.
So it means there is something in vscode that doesn’t follow jupyter (lab)
Cheers
Hai
…On Sun, Nov 17, 2024 at 9:08 PM Don Jayamanne ***@***.***> wrote:
@hai-schrodinger <https://github.com/hai-schrodinger> nglview doesn't
work in VS Code after 3.0.8 as you pointed out.
nglviewer/ngl#1014 (comment)
<nglviewer/ngl#1014 (comment)>
based on my understanding thats the problem, see here (from the above
issue)
Happy to re-open if you can clarify this comment.
Screenshot.2024-11-18.at.13.06.38.png (view on web)
<https://github.com/user-attachments/assets/a7809e6c-17b7-483c-8eb6-aa3ba079ef14>
—
Reply to this email directly, view it on GitHub
<#15757 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AISFXNEPJTLTJHB4LUKQI4L2BFDYHAVCNFSM6AAAAABJFJT6X2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRG44DANBTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
VS Code doesn't use Jupyter Labs application model for registering of widgets, we still use the architecture that was available in Jupyter Notebooks (hence the directories Onto the problem, I can see there's something clearly wrong in the index.js file generated in the If however you look at the similar code in the Basically something wrong in the @hai-schrodinger /cc |
Thank you. That makes sense. Then I think it’s good to close this.
Best
…On Mon, Nov 18, 2024 at 3:46 AM Don Jayamanne ***@***.***> wrote:
vscode. So it means there is something in vscode that doesn’t follow
jupyter (lab) Cheers Hai
VS Code doesn't use Jupyter Labs new widget model, we still use the widget
architecture that was available in Jupyter Notebooks (hence the directories
nbextensions and labextensions. Jupyter Lab uses scripts defined in
labextensions.
I can see there's something cleraly wrong in the index.js file as well in
the nbextensions/nglview-js-widgets/index.js
Line 16229, colum 4410 ,Lt=new s;
The variable s is not defined hence the JS code in index.js falls over.
If however you look at the similar code in the labextensions file, you
can see that the code is new An and the value for An is defined.
Basically something wrong in the index.js file generated for the
nbextensions/nglview-js-widgets/index.js file.
@hai-schrodinger <https://github.com/hai-schrodinger> /cc
—
Reply to this email directly, view it on GitHub
<#15757 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABB645LL3O6LQT7BDLPNKPD2BGSP5AVCNFSM6AAAAABJFJT6X2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBSGI4TSMRTGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Here's another duplicate issue with the same problem nglviewer/nglview#1106 |
Thanks Don.
Does vscode have a plan to use lab instead?
(Just curious since I am going to fix nglview anyway, if it’s possible)
Hai
…On Mon, Nov 18, 2024 at 5:38 PM Don Jayamanne ***@***.***> wrote:
Here's another duplicate issue with the same problem
nglviewer/nglview#1106 <nglviewer/nglview#1106>
—
Reply to this email directly, view it on GitHub
<#15757 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AISFXNDHG5O4IOQS6DDHHAL2BJUAFAVCNFSM6AAAAABJFJT6X2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBUGI4DANJXGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Unfortunately not at this stage, simply because the widgets placed in |
I've created an issue to track such a task, but this will not happen in the short term, definitely not in the next few months. |
Agree. |
It's indeed an issue with Thanks @DonJayamanne again for pointing out the right direction. The original issue was out of my sign since I didn't realize that |
Thanks for looking into this and fixing it |
Related issue nglviewer/nglview#1085.
The example above works in jupyter notebook, but it does not work in vscode. Changing version of nglview and ipywidgets does not fix the problem.
The important part of the log is
nglview-js-widgets is in the cdn https://cdn.jsdelivr.net/npm/nglview-js-widgets/.
jupyter.widgetScriptSources has been configured per https://github.com/microsoft/vscode-jupyter/wiki/IPyWidget-Support-in-VS-Code-Python.
It seems that something goes wrong when loading the module.
The text was updated successfully, but these errors were encountered: