Following plotly dash getting started guide but when trying to run python app.py
get message:
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
Seems the default address: http://127.0.0.1:8050/
is already being used. How can the default port be changed so I can get this to work?
As we can see in Dash.run_server method definition, port can be passed as parameter:
def run_server(self,
port=8050,
debug=True,
threaded=True,
**flask_run_options):
self.server.run(port=port, debug=debug, **flask_run_options)
So, if you need to use another port:
if __name__ == '__main__':
app.run_server(debug=True, port=8051) # or whatever you choose
Note that in Julia, you can change the port by specifying the port number in the run_server
arguments without specifying "port=". For example,
run_server(app, "0.0.0.0", 8000, debug = true)
You can also set the environment variable PORT in your terminal before launching the Dash app:
https://github.com/plotly/dash/blob/c77912a3183adfccfd4ef84df91eca7fa9c7d543/dash/_configs.py#L34
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With