问题
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