Skip to content

No plotly.js found if init_notebook_mode run twice. #458

Closed
@raphtown

Description

@raphtown

Hello,

I have been running into issues when using the offline notebook mode of plotly with jupyter. Specifically, if I run init_notebook_mode twice, and then save and close the notebook with a plotted figure, upon re-opening the figure no longer shows and I can no longer get any plots to show.

Below is a notebook that reproduces the error. To break it, run all cells, then run cell 2 again, save, and close. Upon reload, it is not possible to get a plotly plot to show. Interestingly, if you run cell 1 and 2 again, save, and close, the issue is fixed upon next re-open.

The issue does not show up at all if you do not include a plot in your saved notebook.

Cell 1:

from plotly.offline import init_notebook_mode

Cell 2:

init_notebook_mode()

Cell 3:

import plotly as py
import plotly.graph_objs as go

trace = go.Scatter3d(
    x=[1,0],
    y=[1,0],
    z=[1,0]
)
fig = go.Figure(data=[trace])
py.offline.iplot(fig)

My jupyter logs show the following:

[W 17:32:55.779 NotebookApp] 404 GET /static/plotly.js?v=20160512163326 (127.0.0.1) 4.02ms referer=http://localhost:8895/notebooks/experiments/Test.ipynb

I am running version 1.9.10 as installed from pip on python 2.7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions