Skip to content

nglview not working with vscode-jupyter #15757

Closed
@gcrth

Description

@gcrth

Related issue nglviewer/nglview#1085.

pip install nglview==3.1.0
import nglview
view = nglview.show_pdbid("3pqr")  # load "3pqr" from RCSB PDB and display viewer widget
view

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

Failed to load model class 'ColormakerRegistryModel' from module 'nglview-js-widgets'
Error: No version of module nglview-js-widgets is registered

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.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugipywidgetsRendering, loading, saving, anything to do with IPyWidgetsupstream-otherCause by some other upstream package/app

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions