-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
extension "jupyterlab-plotly" does not yet support the current version of JupyterLab (v4) #4354
Comments
@bsdz you no longer need to install a Jupyter extension to use Plotly in JupyterLab. The current Plotly documentation indicates you just need to install the Python packages |
I beg to differ. This works in my JupyterLab 3.6.5 set up only if I install the the jupyterlab-plotly extension. The documentation is, unfortunately, wrong here. If I remove the extension from my JupyterLab v3 set up then the plots disappear. They reappear again when I reinstall the extension. As I said I earlier, I keep my Jupyter virtual environments separate to my active kernels and this is perhaps why i need to install the lab extension. |
ah, I'm just going by what the docs say on exactly which version this changes to be simpler. But regardless of whether this works with v3 or not, in your original description of the issue you mentioned you tried with JupyterLab v4, where this should apply. ahh right, I don't know if using a distinct Jupyter venv from your kernel venvs would impact this. @alexcjohnson do you know how well that setup is supported? |
I guess I am facing the same issue. I run Plotly plots dont show up. When examinig the raw
A (non-ideal) workaround is to use the
Hints are welcome and if you need further information to narrow down the root cause feel free to ask... |
I am having the same issue in TLJH ( When creating any plotly fig and running Many thanks to @m-erhardt, because the iframe workaround works to make plotly plots appear for now.
|
I was able to fix this issue by adding JupyterLab venv
Kernel venv 1
Kernel venv 2
|
Thanks for the comment @m-erhardt . |
@Coding-with-Adam exactly. I made no other changes besides of bumping The |
@m-erhardt, out of curiosity, are your JupyterLab and kernel venvs on the same host? are they using the same user id? if so, do you ensure their separation by setting different JUPYTER_RUNTIME_DIR, JUPYTER_DATA_DIR and JUPYTER_CONFIG_DIR environment variables for each? |
As mentioned in my first comment in this issue I use JupyterLab behind JupyterHub and spawn an individual JupyterLab container for each user. So there is complete separation between user-environments. My venvs are not exatly "on the same host" but within the same container/image (which is somewhat comparable). So for every user there is one container with one instance of JupyterLab which is always running with the same configuration and environment variables. In order to run individual notebooks with other Python versions and venvs I registered my other virtual environments as ipykernels. /opt/pyenvs/${kernel_venv_1}/bin/python -m ipykernel install --prefix=/opt/pyenvs/${jupyterlab_env} --name 'venv1' --display-name 'Venv 1'
/opt/pyenvs/${kernel_venv_2}/bin/python -m ipykernel install --prefix=/opt/pyenvs/${jupyterlab_env} --name 'venv2' --display-name 'Venv 2'
[...] This will create kernelspec files at You can then select which kernel to use for each notebook from the JupterLab UI. The reasoning behind this is that I always want to use the latest version of Python and JupyterLab for security reasons and to profit from recent bug fixes. But my particular use-case dictates that I need to provide multiple Python versions with pinned package versions for executing notebooks to guarantee reproducible research results. |
@m-erhardt , that's interesting thanks. I'm not using JupyterHub, but I do serve my kernels inside & outside of docker containers using Enterprise Gateway. I'm sure I tested installing plotly in both the JupyterLab venv as well as my kernel venvs already but I will give it another go. Tbh I've parked my migration to JLab4 because of several other issues where 3rd party extensions are yet to be updated. |
Can you comment on the issue discussed in https://community.plotly.com/t/does-plotly-work-with-jupyterlab-4/76095 ? Specifically, I get these JavaScript errors with plotly 5.18 and jupyterlab 4.0.12 and ipywidgets 8.1.1 and :
|
@lahwaacz I can't give an definitive answer but based on the class-loading error message You can check if the extension is present by running As the These extensions are present within my JupyterLab 4.0.12 container:
|
@m-erhardt The JupyterLab Support section in the README says that |
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
@gvwilson Can you comment on #4354 (comment) and #4354 (comment)? Or is the Plotly team itself not sure if JupyterLab v4 is fully supported? 🤷 |
JupyterLab v3 has reached "end of maintenance" as of 2.5 months ago (May 15, 2024): https://blog.jupyter.org/jupyterlab-3-end-of-maintenance-879778927db2 So ideally plotly (and As of today, the latest plotly version 5.23.0 reports as incompatible:
I see a PR was opened that should hopefully address this #4685, so thanks in advance for the effort to get plotly up to date! |
Hi! I recently made a PR (#4822) to update our jupyter support and found that this extension is no longer necessary for newer versions of jupyterlab (>=3) and notebook (>=7). If you look at the top of the output of your |
@marthacryan Yes, see #4354 (comment) |
@lahwaacz Oh okay - do you mind sending the code to reproduce that error? It looks like you might be using the |
@marthacryan Based on the plotly documentation, it seems that the interaction between plotly and jupyterlab is based on I don't understand Plotly's approach to the "support" of various components. There is a difference between "it is supported" and "it just works", since the former is a conscious effort to make it work and the latter might be just "by accident". In the last stable release, 5.24.1, plotly still specifies |
@marthacryan, I tried the --pre version of plotly and this fixes the issue for me. |
@lahwaacz thanks for your feedback - we've been reluctant to pin specific versions of Jupyter and related packages for fear of disrupting things like CI pipelines. We have a clear idea internally of what versions we support in our upcoming release, and you're right, we need to translate that into a support matrix and get it posted soon. However, our priority right now is to wrap up the plotly.py 6.0 release, and the Dash 3.0 release right after it, which means it will be early January before we can produce that. If you would like to mail me ([email protected]) I'd be happy to follow up with you then - I'd like to make sure you're included in discussions. thanks - Greg |
I'm trying to install the lab extension for JupyterLab v4.0.5 with the command:
The conflicting dependencies match what I see in the master branch for 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 text was updated successfully, but these errors were encountered: