Python 运行plotly破折号代码时,在chrome浏览器中加载依赖项时出错

Python 运行plotly破折号代码时,在chrome浏览器中加载依赖项时出错,python,pandas,plotly,plotly-dash,Python,Pandas,Plotly,Plotly Dash,我不熟悉plotly dash并尝试运行Google代码来理解输出。当我在windows cmd提示符下运行下面的代码时,执行返回URL-- 在Chrome浏览器中粘贴上述内容时,浏览器窗口中将显示错误加载依赖项。请找到下面的代码 import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import pandas as pd

我不熟悉plotly dash并尝试运行Google代码来理解输出。当我在windows cmd提示符下运行下面的代码时,执行返回URL-- 在Chrome浏览器中粘贴上述内容时,浏览器窗口中将显示错误加载依赖项。请找到下面的代码

import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd


df = pd.read_excel(
    "https://github.com/chris1610/pbpython/blob/master/data/salesfunnel.xlsx?raw=True"
)

pv = pd.pivot_table(df, index=['Name'], columns=["Status"], values=['Quantity'], aggfunc=sum, fill_value=0)


trace1 = go.Bar(x=pv.index, y=pv[('Quantity', 'declined')], name='Declined')
trace2 = go.Bar(x=pv.index, y=pv[('Quantity', 'pending')], name='Pending')
trace3 = go.Bar(x=pv.index, y=pv[('Quantity', 'presented')], name='Presented')
trace4 = go.Bar(x=pv.index, y=pv[('Quantity', 'won')], name='Won')

app = dash.Dash()
app.layout = html.Div(children=[
    html.H1(children='Sales Funnel Report'),
    html.Div(children='''National Sales Funnel Report.'''),
    dcc.Graph(
        id='example-graph',
        figure={
            'data': [trace1, trace2, trace3, trace4],
            'layout':
            go.Layout(title='Order Status by Customer', barmode='stack')
        })
])
app.scripts.config.serve_locally = True
app.css.config.serve_locally = True
if __name__ == '__main__':
    app.run_server(port=3003)

if __name__ == '__main__':
    app.run_server(debug=True)

我对这个问题不太清楚。但我在这里结束,因为我得到了同样的错误,因为我重命名了一个div id,但我仍然试图在我的回调函数中获取旧id作为状态输入


把它放在这里以防万一对别人有帮助

我的代码碰巧遇到了这个错误,升级Dash包有助于解决这个问题

pip安装仪表板--升级


在1.4.0版之前,升级使其成为1.9.1版

我在chrome中运行了这段代码。Dash可以缓存很多东西。尝试删除所有缓存和cookie,然后重试,或者查看它是否在其他浏览器中工作。在Dash中开发时,我总是使用隐姓埋名。对我来说,它也可以与chrome配合使用。