nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
788 stars 132 forks source link

Compatibility with jupyterlab 4 #1088

Closed mkrompiec closed 7 months ago

mkrompiec commented 7 months ago

Is it possible to use nglview with jupyterlab 4? I would like to avoid downgrading to jupyterlab 3. nglview.demo()gives me Loading widget... and no other output. Tried with the latest release and the main branch from git. Versions 3.0.3 and 3.0.5 give me Error displaying widget.

python -c 'import nglview; print(nglview.__version__)'
python -c 'import ipywidgets; print(ipywidgets.__version__)'
3.0.8
7.7.3
hainm commented 7 months ago

Dear @mkrompiec: noted for the issue. I don't have the answer yet (probably No, we need to update code to support).

mkrompiec commented 7 months ago

Thanks! Looking forward to the fix :)

mkrompiec commented 7 months ago

However, this issue https://github.com/nglviewer/nglview/issues/1082 seems to suggest that it should work with JupyterLab 4...

hainm commented 7 months ago

@mkrompiec oh, you need to use ipywidgets >= 8

image
hainm commented 7 months ago

I've tested with below env

mamba create -n lab4 python=3.10 jupyterlab=4 -c conda-forge
source activate lab4
mamba install nglview -c conda-forge
mkrompiec commented 7 months ago

Thanks! This solves the problem!