Skip to content

Commit 64d540b

Browse files
committed
Fix conda reading host from environment
1 parent b21410d commit 64d540b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dash/dash.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,7 @@ def delete_resource(resources):
20052005
# pylint: disable=protected-access
20062006
delete_resource(self.css._resources._resources)
20072007

2008+
# pylint: disable=too-many-branches
20082009
def run(
20092010
self,
20102011
host: Optional[str] = None,
@@ -2137,7 +2138,13 @@ def run(
21372138

21382139
# Evaluate the env variables at runtime
21392140

2140-
host = host or os.getenv("HOST", "127.0.0.1")
2141+
if "CONDA_PREFIX" in os.environ:
2142+
# Some conda systems has issue with setting the host environment
2143+
# to an invalid hostname.
2144+
# Related issue: https://github.com/plotly/dash/issues/3069
2145+
host = host or "127.0.0.1"
2146+
else:
2147+
host = host or os.getenv("HOST", "127.0.0.1")
21412148
port = port or os.getenv("PORT", "8050")
21422149
proxy = proxy or os.getenv("DASH_PROXY")
21432150

0 commit comments

Comments
 (0)