【问题标题】:Webpage not loading when using Dash in Python在 Python 中使用 Dash 时网页未加载
【发布时间】:2019-09-06 04:18:38
【问题描述】:

我正在尝试在 python 中使用 Dash 模块构建仪表板,但是当我运行以下代码时,没有任何弹出。

我手动将http://127.0.0.1:8050/ 复制并粘贴到网络浏览器,但它显示“无法访问此站点”

import dash  
import dash_core_components as dcc  
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div('Dash')

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

这是我收到的错误消息:

import dash...
Running on http://127.0.0.1:8050/
Running on http://127.0.0.1:8050/
Debugger PIN: 
Debugger PIN:
 * 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
An exception has occurred, use %tb to see the full traceback.

SystemExit: 1

【问题讨论】:

  • 我复制并粘贴了您的代码以在我的机器上运行。它工作正常,页面加载显示“Dash”。

标签: python plotly-dash


【解决方案1】:

您使用的是什么 IDE?我正在使用 PyCharm,当我单击控制台中的链接时,它似乎可以工作。确保一直滚动到底部,以确保您单击的链接来自运行的最后一段代码。我不能告诉你为什么会这样,但在遇到同样的问题后,这对我有用。

【讨论】:

    猜你喜欢
    • 2022-11-19
    • 2019-04-04
    • 2021-02-16
    • 2020-11-21
    • 2019-10-05
    • 1970-01-01
    • 2017-01-26
    • 2018-08-25
    • 2019-09-19
    相关资源
    最近更新 更多