python - Plotly Dash 应用程序未运行
问题描述
我正在尝试从 jupyter notebook 运行以下代码:
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),
html.Div(children='Dash: A web application framework for Python.'),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
])
if __name__ == '__main__':
app.run_server()
它产生以下内容:
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
* Restarting with stat
当我点击http://127.0.0.1:8050/时,页面永远不会加载
解决方案
推荐阅读
- java - 如何包含依赖关系的 Javadoc 和源代码
- reactjs - 道具未在 NextJs 中渲染
- java - Main.java:12:错误:缺少返回语句 } ^
- spring-security - spring-security-saml2-service-provider 的“未提供 KeyInfo 生成器”
- ios - 我想我已经完成了必要的代码签名工作,但在 Ionic 中构建仍然失败
- python - 缩放 GeoJSON 以查找附近的纬度和经度点
- python - 支持命令 discord.py
- java - Netflix zuul:通过 HTTP CONNECT 调用为 squid 等出站代理服务器配置 TLS 传递
- python - 遍历页面的while循环中的StaleElementReferenceException
- amazon-web-services - 通过 CLI 自动发布 AWS Marketplace