Open summa-code opened 1 month ago
@T4rk1n can you please have a look at this one and let me know what you think?
I'm guessing this has to do with #2908 which fixed the load order but seems there is a conflict with conda setting the HOST environment on it's own.
Not able to reproduce with latest miniconda3. Can we have more info on os, shell and anaconda/miniconda version?
Hello, I encountered the same issue, and I found that it's caused by the HOST setting in Conda. You can check it by running echo $HOST
.
Below, I’m providing a temporary workaround where you can remove the HOST definition at the beginning of each script:
import os
if os.getenv('HOST'):
del os.environ['HOST']
You can test it by running the following code:
import os
from dash import Dash, html
# Check and remove the HOST environment variable
if os.getenv('HOST'):
del os.environ['HOST']
app = Dash()
app.layout = [html.Div(children='Hello World')] # Add Layout
if __name__ == '__main__':
app.run_server(host='127.0.0.1', port='8050', debug=True)
I suspect there's a bug where run_server()
is ignoring the provided host? I set my env var to HOST=127.0.01
before running my script and it worked like a charm. Looked at dash.py
, I see the following code block, which I suspect is overriding the provided host
parameter to run_server (self.run) (along with port and proxy):
# Evaluate the env variables at runtime
host = os.getenv("HOST", host)
port = os.getenv("PORT", port)
proxy = os.getenv("DASH_PROXY", proxy)
This is occurring in latest Dash 2.18.1. Doing this app.run_server(host='0.0.0.0') .... did nothing
https://github.com/plotly/dash/issues/1480 Referring to old issue. It expects HOST environment variable to be set under conda. Passing this host parameter is not overriding.