web application using dash in python

旧时模样 提交于 2021-01-28 06:10:55

问题


I have develop a simple program using dash plotly in spyder but it showing me the following error.

import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div(
        html.H1(children='Hello Dash')
)
if __name__ == '__main__':
    app.run_server(debug=True)

but it showing me the following error.

Running on http://127.0.0.1:8050/
Debugger PIN: 870-923-677
Traceback (most recent call last):

  File "<ipython-input-13-3c5b23764cd8>", line 5, in <module>
    app.run_server(debug=True)

  File "C:\Users\Hussnain\Anaconda3\lib\site-packages\dash\dash.py", line 1503, in run_server
    self.server.run(port=port, debug=debug, **flask_run_options)

  File "C:\Users\Hussnain\Anaconda3\lib\site-packages\flask\app.py", line 938, in run
    cli.show_server_banner(self.env, self.debug, self.name, False)

  File "C:\Users\Hussnain\Anaconda3\lib\site-packages\flask\cli.py", line 629, in show_server_banner
    click.echo(message)

  File "C:\Users\Hussnain\Anaconda3\lib\site-packages\click\utils.py", line 259, in echo
    file.write(message)

UnsupportedOperation: not writable

回答1:


Spyder has some conflicts using Debug=True. Please run your code inside Visual Studio Code.

For my system: Your code is running fine.

Please tell us if this software swap solved your problem. If not, I will provide further assistance. :)



来源:https://stackoverflow.com/questions/56202722/web-application-using-dash-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!