Hi!
After upgrading jupyter notebook to v5 -
when using plotly with init_notebook_mode(connected=False) (which is the default flag), with each call to iplot an exception is raised
Uncaught Error: Script error for "plotly"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:165)
at HTMLScriptElement.onScriptError (require.js:1732)
The canvas is still drawn but it's white.
when reverting to notebook v4.3.2, plotly works again.
Note that if using connected=True (which will fetch plotly.js from the CDN) it will work.
Thanks!
I'm having the same issue, offline plot does not work with Jupyter 5.

Library versions:
jupyter==1.0.0
jupyter-client==5.0.1
jupyter-console==5.1.0
jupyter-core==4.3.0
plotly==2.0.8
@averri I ran your code with the same library versions and I got an empty plot too. It displays the plot in jupyter notebook 5.0.1 only if you import download_plotlyjs:
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
init_notebook_mode()
import plotly.graph_objs as go
import numpy as np
x=np.linspace(0, 1, 100)
y=np.sin(2*np.pi*x)
fig=go.Figure(data=[go.Scatter(x=x,
y=y)]
)
iplot(fig)
Is there a workaround for this? Or is there a relatively easy way to downgrade my Jupyter version to one that works?
I am having the same issue with Jupyter 5.0 and plot.ly.
Generally, I can run a notebook once and the plot.ly charts will show, but if I close the re-run the notebook, I get white space where the plots should be. Adding insult to injury, if I copy and paste all the cells from a "broken notebook" into a fresh one, it works again.
Here's the error I get on the browser console:
Uncaught Error: Script error for "plotly"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:165)
at HTMLScriptElement.onScriptError (require.js:1732)
@asiderop
I could not figure out how to downgrade Jupyter Notebook alone with conda (conda wanted to uninstall all dependencies). I did a...
pip uninstall notebook==5.0.0
then a...
pip install notebook==4.4.0
That seems to have properly downgraded me. I can still see notebook5.0.0 in my pkgs folder of my conda directory, but it's not active when I launch Juptyer from cmd. Juptyer 5.0 seems to be quite buggy w.r.t. plotting (I already had to hack and hardcode a fix with data streaming limits being hit).
There is a special rendering plug-in now
jupyter labextension install @jupyterlab/plotly-extension
Has anyone been able to successfully install and use the plotly extension with jupyter or jupyter lab? I borked my dev env today trying to migrate my analytics environmemt to jupyter lab and now have this wierd issue with offline.plot, iplot works fine but i think im having the Jupyter v5 issues described above. After i installed nodejs via conda and then tried installing the extension i got failures at the end of the extension install. I tried adding missing js dependencies but could never get them to install correclty and could never get the extension install to succeed. Monday I'm thinking to roll back the jupyter version since it was upgraded during the jupyter lab install.
Please follow the detailed instructions in the plotly.py README (https://github.com/plotly/plotly.py) for getting plotly.py working in the Jupyter notebook and in JupyterLab. I'm going to close this for now, but feel free to open a new issue against the current versions of everything if you're still having trouble.
I have been using plotly in offline mode from within Jupyter notebook. I have been getting the plots. But suddenly today I see that I am either getting a blank output (no error but no plot as well) for the following code:
import plotly.offline as pltly
import plotly.graph_objs as go
import numpy as np
N = 500
random_x = np.linspace(0, 1, N)
random_y = np.random.randn(N)
trace = go.Scatter(
x = random_x,
y = random_y
)
data = [trace]
pltly.iplot(data, filename='basic-line')
Or showing this error: "Aw, snap! We didn't get a username with your request.
Don't have an account? https://plot.ly/api_signup
Questions? [email protected]" for similar codes like the following:
cf.datagen.lines().iplot(kind='scatter',xTitle='Dates',yTitle='Returns',title='Cufflinks - Line Chart')
or
import plotly.offline as pltly
import cufflinks as cf
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(10, 4), columns=['a', 'b', 'c', 'd'])
df.iplot(kind='area', fill=True, filename='cufflinks/stacked-area')
jupyter notebook version= 5.7.4
plotly = 3.7.0
Most helpful comment
@averri I ran your code with the same library versions and I got an empty plot too. It displays the plot in jupyter notebook 5.0.1 only if you import
download_plotlyjs: