【问题标题】:Running dash on JupyterLab returns an error在 JupyterLab 上运行 dash 返回错误
【发布时间】:2020-03-13 22:29:38
【问题描述】:

我尝试按照从here 构建数据仪表板的示例。
这是在 JupyterLab 上运行的代码。

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

但是,使用以下代码激活 Dash 服务器会返回错误。

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

错误信息:

An exception has occurred, use %tb to see the full traceback.

SystemExit: 1
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3334: UserWarning:

To exit: use 'exit', 'quit', or Ctrl-D.

我将debug=True 更改为debug=False,但服务器(http://127.0.0.1:8050/)未打开。相反,它会在不打开新页面的情况下继续处理。
感谢您的帮助。

【问题讨论】:

    标签: python dashboard plotly-dash


    【解决方案1】:

    您需要安装jupyter-plotly-dash,但它处于“alpha”开发阶段。建议安装并运行在virtualenv。众所周知,使用 system-python 时会出现问题。

    您可能还需要运行:

    sudo pip3 install jupyter_server_proxy
    jupyter serverextension enable jupyter_server_proxy
    

    另请参阅 github 上的 this discussion

    【讨论】:

    • 谢谢。我应用了它,但出现了同样的错误消息。
    • 您是否使用virtualenv 安装jupyter-plotly-dash 并运行jupyter notebook
    猜你喜欢
    • 1970-01-01
    • 2012-05-25
    • 2019-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-04
    • 2013-06-26
    • 1970-01-01
    相关资源
    最近更新 更多