-
-
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
Plotly plots not working in Jupyterlab #2672
Comments
I have the same issues, with the same browser console error.
Figures show up fine in Jupyter Notebook however. Any help would be appreciated. |
I got it working using the steps from here plotly/plotly_express#38 because I had similar js errors in my browser console log. The exact commands I used were as follows
I'm not sure exactly which extension was causing issues but hope this helps someone else. |
This is the same issue as #2742 I suspect. |
I have the same problem with the same error in the brower javascript console both in Safari and Chrome. The solution by @shrestha-pranav did not fix it for me. Plotly works in jupyter notebook.
|
I figured out that setting |
In some cases I've found that just running Either way, if folks could share their NodeJS version as well, that might help pinpoint a common cause for these issues. |
Hi Nicolas. |
Ok, thanks for that version! What error message appears in the JS console when you render a plot and see no output? |
|
This is the renderer configuration that it has.
when i do nothing happens and no error shows up in the java script console. when i do i get a blank space and the error shows up in the java script console. So I assume it does the |
In chrome i can click on 'require not defined` and this code shows up:
|
In jupyter notebook it works. Same environment. |
Right, so JupyterLab and Classic Notebook have two completely different rendering paths.
The renderer system auto-detects the notebook vs lab environment and sets the default mode for the current environment, so in principle you shouldn't need to specify the mode by passing anything into If things aren't working for you in JupyterLab, then something is wrong with the |
@nicolaskruchten believe it or not, but i managed to get it working on one of my environments. Though that one is a bit older than the other one.
|
OK nice! So... what's different about this environment? Do things break if you install the other labextensions? All the ones you had before were developed at Plotly or required by them (the manager) so I'd be surprised if they conflict with each other somehow but hey, if they do I know who to ask to get it fixed :) |
I installed two more extensions and it still works. Now i have interactive widget support =) That's what i was looking for.
|
Same problem, My installation:
Update: Just noticed the JupyterLab extensions for plotly, installed from the command-line per plotly instructions, do not subsequently show-up in the "INSTALLED" section of the JupyterLab Extension Manager. Could that be the issue? I can't say presently. Will keep investigating. 2nd update: Got it working. I had an earlier JupyterLab version installed in my "base" environment, and the latest JupyterLab version and extensions in my working environment. I was starting JupyterLab from the base environment and not getting the latest version + extensions. All's well. |
|
sample blank image under the cell on jupyterlab
None of the above solutions worked
setting pio.renderers.default to iframe |
I too tried all of the above without any joy. The thing that ended up working for me was to reset the application state (after first installing the
I've attached a GIF of this process for clarity: For reference, my lab extensions look like the following:
And my method of actually rendering the plot is to use from plotly.offline import download_plotlyjs, init_notebook_mode, iplot, plot
...
iplot(fig, validate=False) |
I'm having all the issues mentioned above, none of the solutions are working. Have tried setting up a fresh conda environment, have followed all the troubleshooting on the website and browsed a variety of github issues and stack overflow posts. Guess I'll be heading back to notebooks having spent a few hours trying to sort this :( |
Have you tried the latest version of JupyterLab and plotly? I think i read somewhere that there was something fixed, but not sure. |
I've got the same issue with latest version of Lab & Dash: |
I managed to make it work in jupyter lab using: import plotly.io as pio
pio.renderers.default='iframe' |
I got it working by installing the "jupyterlab-plotly" extension. In the anaconda command prompt:
and then
Even though I am using jupyterlab version 3.0.14 and it says in the documents that we don't need to install extra extensions for jupyterlab. But it seems that's not the case for me. now when I use:
|
It's 2024 and this still doesn't work in JupyterHub 4. Same error -- that seems straightforward to me to for JupyterLab/Hub developers to fix: And now labextensions are deprecated and/or disabled. I'll have to live with the iframe renderer for now, but iframe really wrecks the "live" notebook experience.
|
When I run this example:
in a Jupyter notebook under jupyter lab I get no output. The output cell expands as if it is going to show output, but it is just blank. I see this error in the browser console:
Googling I see others that had that problem had bad installs of extensions, I don't think I have that:
My jupyterlab + extension versions are:
Thanks for any help with this.
Matt
The text was updated successfully, but these errors were encountered: