You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
Hello,
When I run code cell second time in the notebook, I am getting OSError: Address 'http://127.0.0.1:8050' already in use. The only thing that helps is restarting kernel.
Is this an expected behaviour? If so, it makes it hard to use jupyter-dash to develop app.
jupyter-dash 0.4.2 Ubuntu 22.04
Example script
from dash import dcc, html
from jupyter_dash import JupyterDash as Dash
app = Dash(__name__)
app.layout = html.Div([
html.Div(children='Hello World')
])
app.run_server(debug=True)
The text was updated successfully, but these errors were encountered:
Hey, I also had this issue, chatGPT gave me the below which works for me.
`import socket
from contextlib import closing
def find_free_port():
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
s.bind(('',0)) # '' means localhost and 0 means to find a free port
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
return s.getsockname()[1]
Then you can use this function when you run your Dash app
if name == 'main':
port = find_free_port()
app.run_server(debug=True, port=port)
`
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
When I run code cell second time in the notebook, I am getting
OSError: Address 'http://127.0.0.1:8050' already in use.
The only thing that helps is restarting kernel.Is this an expected behaviour? If so, it makes it hard to use jupyter-dash to develop app.
jupyter-dash 0.4.2
Ubuntu 22.04
Example script
The text was updated successfully, but these errors were encountered: