Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name or service not known when running a Dash app

My setup is quite straightforward, but it fails to run. I suspect it has to do with the server address (I think it should be https://127.0.0.1:8050) but have no idea how to change that. Any suggestions highly appreciated. - Setup an virtual environment and installed dash (using pip install dash). It installed flask as well.

My basic setup for the app:

import dash
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div(
    html.H1(children="Hello World!")
)

if __name__ == '__main__':
    app.run_server(debug=True)

When I run my app in the terminal, I get the following error:

(Dash) rene@ideapad:~/Projects/Dash$ python my_app.py 
Running on http://x86_64-conda_cos6-linux-gnu:8050/
Debugger PIN: 287-942-334
 * Serving Flask app "my_app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
Traceback (most recent call last):
  File "my_app.py", line 12, in <module>
    app.run_server(debug=True)
  File "/home/rene/Environments/Dash/lib/python3.7/site-packages/dash/dash.py", line 1973, in run_server
    self.server.run(host=host, port=port, debug=debug, **flask_run_options)
  File "/home/rene/Environments/Dash/lib/python3.7/site-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/home/rene/Environments/Dash/lib/python3.7/site-packages/werkzeug/serving.py", line 1030, in run_simple
    s.bind(server_address)
socket.gaierror: [Errno -2] Name or service not known
like image 835
Rene Avatar asked Apr 03 '20 06:04

Rene


1 Answers

I solved the issue by setting the host and port manually:

if __name__ == '__main__':
    app.run_server(host='127.0.0.1', port='8050', debug=True)

But I still have no clue why it started using http://x86_64-conda_cos6-linux-gnu:8050.

Any suggestion?

like image 195
Rene Avatar answered Nov 14 '22 23:11

Rene