Include_plotlyjs = 'cdn' not work

Hi all,
this is my code

import plotly as py
import pandas as pd
import numpy as np

from datetime import datetime
from datetime import time as dt_tm
from datetime import date as dt_date

# import plotly.plotly as py
import as plotly_tools
import plotly.graph_objs as go

import os
import tempfile
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()
# from import quotes_historical_yahoo
import matplotlib.pyplot as plt

from scipy.stats import gaussian_kde

from IPython.display import HTML
import as px

long_df =

fig =, x="nation", y="count", color="medal", title="Long-Form Input")
import as pio
def convert_fig_to_html(fig):
    html=open("file.html", "r")
    return html
html_string = '''
        <script src=""></script> 
        <h3>Reference table: stock tickers</h3>
        ''' + convert_fig_to_html(fig) + '''
        <h3>Summary table: 2014 stock statistics</h3>
        ''' + convert_fig_to_html(fig) + '''

f = open('report.html','w')

When I open html file, it not show charts. It have error:

if I use include_plotlyjs =β€˜False’, it will show chart, but the file size too large.
Are there any solution for this problems?

Plotly had some trouble with their data behind the CDNs; see: Plotly.js CDN down?

This seems to be fixed, so you can try again!

1 Like