question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local offline mode does not work in Jupyter Notebook 5

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
empetcommented, May 30, 2017

@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)
0reactions
priyankakgpcommented, Mar 12, 2019

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)

Create a trace

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? accounts@plot.ly” for similar codes like the following:


#Linechart 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing Jupyter Notebook (Offline mode) - IBM
Use the following steps to install Jupyter Notebooks in an offline environment. ... Do not change to /usr/local/bin/pip3.5. Compress the offline ...
Read more >
does jupyter notebook works offline in windows, if so then how?
Yes, you don't need an internet connection to run jupyter notebook because it runs on the localhost. after you install anaconda you will...
Read more >
jupyter-offlinenotebook - PyPI
Save and load notebooks to local-storage.
Read more >
Frequently Asked Questions — FiftyOne 0.18.0 documentation
Can I use FiftyOne in a remote notebook? Yes! It is possible to work with a Jupyter notebook in your local browser that...
Read more >
Launching SageMath - Installation Guide
Otherwise you are strongly advised to create shortcuts for Sage as indicated at ... To start a Jupyter Notebook instead of a Sage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found