russ
July 4, 2024, 9:24pm
5
FIXED! I now have interactive plotly plots working with jupyterlab 4.2! No need to downgrade to v3.x.
I went looking in github to see if there were known issues and/or anything I could contribute back to fix this problem… and I found this awesome post:
opened 10:00PM - 12 Sep 23 UTC
I'm trying to install the lab extension for JupyterLab v4.0.5 with the command:
…
```bash
$ jupyter labextension install jupyterlab-plotly
(Deprecated) Installing extensions with the jupyter labextension install command is now deprecated
and will be removed in a future major version of JupyterLab.
Users should manage prebuilt extensions with package managers like pip and conda, and extension
authors are encouraged to distribute their extensions as prebuilt packages
/pyenvs/jupyterlab-4.x/.venv/lib/python3.10/site-packages/jupyterlab/debuglog.py:56:
UserWarning: An error occurred. warnings.warn("An error occurred.")
/pyenvs/jupyterlab-4.x/.venv/lib/python3.10/site-packages/jupyterlab/debuglog.py:57:
UserWarning: ValueError: The extension "jupyterlab-plotly" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
>=2.0.0 <3.0.0 >=1.2.3 <2.0.0 @lumino/messaging
>=2.0.1 <3.0.0 >=1.8.1 <2.0.0 @lumino/widgets
warnings.warn(msg[-1].strip())
/pyenvs/jupyterlab-4.x/.venv/lib/python3.10/site-packages/jupyterlab/debuglog.py:58: UserWarning: See
the log file for details: /tmp/jupyterlab-debug-l5ilibax.log
warnings.warn(f"See the log file for details: {log_path!s}")
```
The conflicting dependencies match what I see in the master branch for [packages/javascript/jupyterlab-plotly/package.json](https://github.com/plotly/plotly.py/blob/11b4936dd7efaf16a6ca1ab2cb936b2f04047e18/packages/javascript/jupyterlab-plotly/package.json).
I keep my jupyter virtual environment separate to my working kernels. I'm not sure if there's a different way to install plotly for JupyterLab v4.
The magic trick required is to install plotly in the python environment that is running jupyterlab (and jupyterhub in my case). Works great now!!
1 Like