plotly / jupyter-dash

OBSOLETE - Dash v2.11+ has Jupyter support built in!
https://dash.plotly.com/dash-in-jupyter
MIT License
960 stars 233 forks source link

ConnectionError: HTTPConnectionPool: Max retries exceeded #15

Open reckoner opened 4 years ago

reckoner commented 4 years ago
ConnectionError: HTTPConnectionPool(host='x86_64-conda_cos6-linux-gnu', port=8050): Max retries exceeded with url: /_alive_a3a79a8c-7956-4602-96cc-f8f88ec33619 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4dd6f53a58>: Failed to establish a new connection: [Errno -2] Name or service not known'))

I'm trying to run the demo code as shown here

jonmmease commented 4 years ago

Hi @reckoner, thank for trying out jupyter-dash.

We'll need a bit more information to help. In particular:

  1. How are you running Jupyter (locally, on JupyterHub, etc.)?
  2. Are you running JupyterLab or the Classic Notebook?
  3. How did you install jupyter-dash?

To try out examples, you can also run jupyter-dash using binder: image.

reckoner commented 4 years ago
  1. running locally jupyter notebook
  2. classic notebook (I tried jupyterlab but that didn't work either, same error)
  3. conda install -c plotly jupyter-dash

Yes. I tried the binder and it looked great! I also downloaded the IPYNB from the binder and tried it locally, but no such luck.

Thanks!

mail2julian commented 4 years ago

same error

msbuckas commented 4 years ago

I was getting this primary error with the demo code that the OP referenced!

ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

and the secondary error

_ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8050): Max retries exceeded with url: /_alive76071299-760d-44ff-82d5-83aca0100737 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001F28514E348>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

I set debug to False in run_server(...) to fix my error:

app.run_server(mode='inline', debug=False)

I appreciate that the OP's error message is different (yet similiar?) but that may be because of different environment setups? :

Anyway, its worth a try - apologies if I got it wrong and hijacked this thread!

adalseno commented 4 years ago

Hi, I have a similar error on my Mac Os X 10.14.6 with Anaconda (python 3.7.7) both in Jupyter notebook and jupyterlab. The line JupyterDash.infer_jupyter_proxy_config()does not help. On the notebook it doesn't do anything on lab it does not block the system but has always an asterisk (*) on the cell.

(base) iMac-di-Andrea:~ andrea$ jupyter labextension list
JupyterLab v2.0.1
Known labextensions:
   app dir: /Users/andrea/opt/anaconda3/share/jupyter/lab
        jupyterlab-dash v0.2.0  enabled  OK
(base) iMac-di-Andrea:~ andrea$ jupyter serverextension enable --sys-prefix jupyter_server_proxy
Enabling: jupyter_server_proxy
- Writing config: /Users/andrea/opt/anaconda3/etc/jupyter
    - Validating...
      jupyter_server_proxy  OK

I tried to restart the server but with no luck. List of packages

# packages in environment at /Users/andrea/opt/anaconda3/envs/joseml:
#
# Name                    Version                   Build  Channel
absl-py                   0.9.0                    pypi_0    pypi
aiohttp                   3.6.2                    pypi_0    pypi
ansi2html                 1.5.2            py37hc8dfbb8_1    conda-forge
anyjson                   0.3.3                    py37_1  
appdirs                   1.4.3                    pypi_0    pypi
appnope                   0.1.0                    py37_0  
argon2_cffi               19.1.0           py37h1de35cc_0  
arrow                     0.13.1                   py37_0  
asn1crypto                1.3.0                    py37_0  
astor                     0.8.1                    pypi_0    pypi
astropy                   4.0.1.post1      py37h9bfed18_0    conda-forge
async-timeout             3.0.1                    pypi_0    pypi
attrs                     19.3.0                     py_0  
autofeat                  1.1.2                    pypi_0    pypi
babel                     2.8.0                      py_0  
backcall                  0.1.0                    py37_0  
bcrypt                    3.1.7            py37h1de35cc_0  
beautifulsoup4            4.9.0                    py37_0  
blas                      1.0                    openblas  
bleach                    3.1.4                      py_0  
bokeh                     2.0.2                    py37_0  
brotlipy                  0.7.0           py37h9bfed18_1000    conda-forge
bs4                       0.0.1                    pypi_0    pypi
ca-certificates           2020.6.20            hecda079_0    conda-forge
cairo                     1.14.12              hc4e6be7_4  
catboost                  0.22                     py37_0    conda-forge
category_encoders         2.1.0                      py_0    conda-forge/label/cf202003
cctools                   927.0.2              h5ba7a2e_4  
certifi                   2020.6.20        py37hc8dfbb8_0    conda-forge
cffi                      1.14.0           py37hb5b8e2f_0  
chardet                   3.0.4                 py37_1003  
chart-studio              1.1.0                      py_0    plotly
clang                     9.0.1           default_hf57f61e_0    conda-forge
clang-tools               9.0.1           default_hf57f61e_0    conda-forge
clang_osx-64              9.0.1                h05bbb7f_0    conda-forge
clangxx                   9.0.1           default_hf57f61e_0    conda-forge
clangxx_osx-64            9.0.1                h05bbb7f_0    conda-forge
click                     7.1.2                      py_0  
cloudpickle               1.4.1                      py_0  
cmdstanpy                 0.4.0                    pypi_0    pypi
colorama                  0.4.3                    pypi_0    pypi
colorlover                0.3.0                    pypi_0    pypi
colour                    0.1.5                    py37_0  
compiler-rt               9.0.1                h6a512c6_3    conda-forge
compiler-rt_osx-64        9.0.1                h99342c6_3    conda-forge
confuse                   1.1.0              pyh9f0ad1d_0    conda-forge
convertdate               2.1.3                   py_1000    conda-forge
cryptography              2.9.2            py37ha12b0ac_0  
cssselect                 1.1.0                    pypi_0    pypi
cufflinks                 0.17.0                   pypi_0    pypi
cycler                    0.10.0                   py37_0  
cymem                     2.0.2            py37h04f5b5a_0  
cython                    0.29.16                  pypi_0    pypi
cytoolz                   0.9.0.1          py37h1de35cc_1  
dash                      1.13.3             pyh9f0ad1d_0    conda-forge
dash-core-components      1.10.1             pyh9f0ad1d_0    conda-forge
dash-html-components      1.0.3              pyh9f0ad1d_0    conda-forge
dash-renderer             1.5.0              pyh9f0ad1d_0    conda-forge
dash-table                4.8.1              pyh9f0ad1d_0    conda-forge
dask                      2.17.2                     py_0  
dask-core                 2.17.2                     py_0  
decorator                 4.4.2                      py_0  
defusedxml                0.6.0                      py_0  
dill                      0.3.1.1                  pypi_0    pypi
distributed               2.17.0                   py37_0  
eli5                      0.10.1                   py37_1    conda-forge
en-core-web-sm            2.0.0                    pypi_0    pypi
entrypoints               0.3                      py37_0  
ephem                     3.7.7.0          py37h1de35cc_0  
et_xmlfile                1.0.1                    py37_0  
expat                     2.2.6                h0a44026_0  
fake-useragent            0.1.11                   pypi_0    pypi
fbprophet                 0.6              py37h4a8c4bd_0    conda-forge
filelock                  3.0.12                   pypi_0    pypi
flask                     1.1.2              pyh9f0ad1d_0    conda-forge
flask-compress            1.5.0              pyh9f0ad1d_0    conda-forge
fontconfig                2.13.0               h5d5b041_1  
freetype                  2.9.1                hb4e5f40_0  
fribidi                   1.0.5                h1de35cc_0  
fsspec                    0.7.4                      py_0  
furl                      2.1.0                      py_0  
future                    0.18.2           py37hc8dfbb8_1    conda-forge
gast                      0.2.2                    pypi_0    pypi
gettext                   0.19.8.1             h15daf44_3  
glib                      2.63.1               hd977a24_0  
google                    2.0.3                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
graphite2                 1.3.13               h2098e52_0  
graphviz                  2.40.1               hefbbd9a_2  
grpcio                    1.27.2                   pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
harfbuzz                  1.8.8                hb8d4a28_0  
heapdict                  1.0.1                      py_0  
holidays                  0.10.1                     py_0    conda-forge
html5lib                  1.0.1                    py37_0  
htmlmin                   0.1.12                     py_1    conda-forge
icu                       58.2                 h0a44026_3  
idna                      2.9                        py_1  
imagehash                 4.1.0              pyh9f0ad1d_0    conda-forge
imbalanced-learn          0.6.2                      py_0    conda-forge
importlib_metadata        1.5.0                    py37_0  
infinity                  1.4                      py37_0  
intervals                 0.8.1                    py37_0  
ipykernel                 5.1.4            py37h39e3cac_0  
ipython                   7.13.0           py37h5ca1d4c_0  
ipython_genutils          0.2.0                    py37_0  
ipywidgets                7.5.1                      py_0    conda-forge
itsdangerous              1.1.0                      py_0    conda-forge
jdcal                     1.4.1                      py_0  
jedi                      0.17.0                   py37_0  
jinja2                    2.11.2                     py_0  
joblib                    0.14.1                     py_0  
jpeg                      9b                   he5867d9_2  
jsonschema                3.2.0                    py37_0  
jupyter-dash              0.2.1.post1                py_0    plotly
jupyter_client            6.1.3                      py_0  
jupyter_core              4.6.3                    py37_0  
keras-applications        1.0.8                    pypi_0    pypi
keras-preprocessing       1.1.0                    pypi_0    pypi
kiwisolver                1.2.0            py37h04f5b5a_0  
ld64                      450.3                h3c32e8a_4    conda-forge
libcxx                    10.0.0               h1af66ff_2    conda-forge
libcxxabi                 4.0.1                hcfea43d_1  
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.2.1                h0a44026_6  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.16                 h1de35cc_0  
libllvm10                 10.0.0               h21ff451_0  
libllvm9                  9.0.1                h7475705_1    conda-forge
libopenblas               0.3.6                hdc02c5d_2  
libpng                    1.6.37               ha441bb4_0  
libsodium                 1.0.16               h3efe00b_0  
libtiff                   4.1.0                hcb84e12_0  
libxml2                   2.9.9                hf6e021a_1  
libxslt                   1.1.33               h33a18ac_0  
lightgbm                  2.3.0            py37h0a44026_0  
llvm-openmp               4.0.1                hcfea43d_1  
llvmlite                  0.31.0           py37h1341992_0  
locket                    0.2.0                    py37_1  
lunarcalendar             0.0.9                      py_0    conda-forge
lxml                      4.5.0            py37hef8c89e_0  
markupsafe                1.1.1            py37h1de35cc_0  
matplotlib                3.2.1                         0    conda-forge
matplotlib-base           3.2.1            py37hddda452_0    conda-forge
missingno                 0.4.2                      py_1    conda-forge
mistune                   0.8.4            py37h1de35cc_0  
mlxtend                   0.17.2                     py_0    conda-forge
mpmath                    1.1.0                    pypi_0    pypi
msgpack-numpy             0.4.3.2                  py37_0  
msgpack-python            0.6.1            py37h04f5b5a_1  
multidict                 4.7.6                    pypi_0    pypi
murmurhash                1.0.2            py37h0a44026_0  
nbconvert                 5.6.1                    py37_0  
nbformat                  5.0.6                      py_0  
ncurses                   6.2                  h0a44026_1  
networkx                  2.4                        py_1    conda-forge
nltk                      3.4.5                    py37_0  
notebook                  6.0.3                    py37_0  
numba                     0.48.0           py37h6c726b0_0  
numpy                     1.18.1           py37h0c13f30_0  
numpy-base                1.18.1           py37ha711998_1  
olefile                   0.46                     py37_0  
openpyxl                  3.0.3                      py_0  
openssl                   1.1.1g               h0b31af3_0    conda-forge
opt-einsum                3.2.0                    pypi_0    pypi
orderedmultidict          1.0.1                    py37_0  
packaging                 20.3                       py_0  
pandas                    1.0.3            py37h6c726b0_0  
pandas-datareader         0.8.1                      py_0  
pandas-profiling          2.8.0                      py_0    conda-forge
pandoc                    2.2.3.2                       0  
pandocfilters             1.4.2                    py37_1  
pango                     1.42.4               h060686c_0  
parse                     1.15.0                   pypi_0    pypi
parso                     0.7.0                      py_0  
partd                     1.1.0                      py_0  
passlib                   1.7.2                      py_0  
patsy                     0.5.1                    py37_0  
pcre                      8.43                 h0a44026_0  
pexpect                   4.8.0                    py37_0  
phik                      0.10.0                     py_0    conda-forge
phonenumbers              8.10.19                    py_0  
pickleshare               0.7.5                    py37_0  
pillow                    7.1.2            py37h4655f20_0  
pint                      0.11                     pypi_0    pypi
pip                       20.0.2                   py37_3  
pixman                    0.38.0               h1de35cc_0  
plac                      0.9.6                    py37_0  
plotly                    4.6.0                      py_0  
pmdarima                  1.2.0            py37h56e435c_7    saravji
ppscore                   0.0.2                    pypi_0    pypi
preshed                   2.0.1            py37h0a44026_0  
prometheus_client         0.7.1                      py_0  
prompt-toolkit            3.0.4                      py_0  
prompt_toolkit            3.0.4                         0  
protobuf                  3.11.3                   pypi_0    pypi
psutil                    5.7.0            py37h1de35cc_0  
ptyprocess                0.6.0                    py37_0  
py-spy                    0.3.3                    pypi_0    pypi
pycparser                 2.20                       py_0  
pyee                      7.0.1                    pypi_0    pypi
pygments                  2.6.1                      py_0  
pyopenssl                 19.1.0                   py37_0  
pyparsing                 2.4.7                      py_0  
pyppeteer                 0.0.25                   pypi_0    pypi
pyquery                   1.4.1                    pypi_0    pypi
pyrsistent                0.16.0           py37h1de35cc_0  
pysocks                   1.7.1                    py37_0  
pystan                    2.19.0.0         py37h6440ff4_0  
python                    3.7.7           hc70fcce_0_cpython  
python-dateutil           2.8.1                      py_0  
python-graphviz           0.14                       py_0  
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2019.3                     py_0  
pywavelets                1.1.1            py37h10e2902_1    conda-forge
pyyaml                    5.3.1            py37h1de35cc_0  
pyzmq                     18.1.1           py37h0a44026_0  
ray                       0.8.5                    pypi_0    pypi
readline                  8.0                  h1de35cc_0  
redis                     3.4.1                    pypi_0    pypi
regex                     2020.4.4         py37h1de35cc_0  
requests                  2.23.0                   py37_0  
requests-html             0.10.0                   pypi_0    pypi
retrying                  1.3.3                    py37_2  
scikit-learn              0.22.1           py37hebd9d1a_0  
scipy                     1.4.1            py37hba666df_0  
seaborn                   0.10.1                     py_0  
seglearn                  1.2.1                    pypi_0    pypi
send2trash                1.5.0                    py37_0  
setuptools                46.2.0                   py37_0  
setuptools-git            1.2                      pypi_0    pypi
simplejson                3.17.0           py37h1de35cc_0  
singledispatch            3.4.0.3                  py37_0  
six                       1.14.0                   py37_0  
sortedcontainers          2.1.0                    py37_0  
soupsieve                 2.0                        py_0  
spacy                     2.0.16           py37h6440ff4_0  
sqlalchemy                1.3.16           py37h1de35cc_0  
sqlalchemy-utils          0.36.5                     py_0  
sqlite                    3.31.1               h5c1f38d_1  
statsmodels               0.11.0           py37h1de35cc_0  
sympy                     1.5.1                    pypi_0    pypi
tabulate                  0.8.3                    py37_0  
tangled-up-in-unicode     0.0.6              pyh9f0ad1d_0    conda-forge
tapi                      1000.10.8            ha1b3eb9_0  
tbb                       2019.9               ha1b3eb9_1    conda-forge
tblib                     1.6.0                      py_0  
termcolor                 1.1.0                    pypi_0    pypi
terminado                 0.8.3                    py37_0  
testpath                  0.4.4                      py_0  
thinc                     6.12.1           py37hebd9d1a_0  
tk                        8.6.8                ha441bb4_0  
toolz                     0.10.0                     py_0  
tornado                   6.0.4            py37h1de35cc_1  
tqdm                      4.46.0                     py_0  
traitlets                 4.3.3                    py37_0  
tsfresh                   0.15.1                     py_0    conda-forge
typing_extensions         3.7.4.1                  py37_0  
ujson                     2.0.3            py37h0a44026_0  
urllib3                   1.25.8                   py37_0  
visions                   0.4.4              pyh9f0ad1d_0    conda-forge
w3lib                     1.21.0                   pypi_0    pypi
wcwidth                   0.1.9                      py_0  
webencodings              0.5.1                    py37_1  
websockets                8.1                      pypi_0    pypi
werkzeug                  1.0.1              pyh9f0ad1d_0    conda-forge
wheel                     0.34.2                   py37_0  
widgetsnbextension        3.5.1                    py37_0    conda-forge
wrapt                     1.10.11          py37h1de35cc_2  
xgboost                   0.90                     pypi_0    pypi
xlrd                      1.2.0                    py37_0  
xz                        5.2.5                h1de35cc_0  
yaml                      0.1.7                hc338f04_2  
yarl                      1.4.2                    pypi_0    pypi
zeromq                    4.3.1                h0a44026_3  
zict                      2.0.0                      py_0  
zipp                      3.1.0                      py_0  
zlib                      1.2.11               h1de35cc_3  
zstd                      1.3.7                h5bba6e5_0  

The notebook is absolutely simple:

from jupyter_dash import JupyterDash
import dash
import dash_core_components as dcc
import dash_html_components as html
app = JupyterDash(__name__)
app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),
    html.Div(children='Dash: A web application framework for Python.'),

    dcc.Graph(
        id='example-graph',
        figure={
            'data': [
                {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
                {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
            ],
            'layout': {
                'title': 'Dash Data Visualization'
            }
        }
    )
])
# Run app and display result inline in the notebook
#app.run_server(mode='inline')
app.run_server()

Inline, external or jupyterlab doesn't make any difference. The error is:

---------------------------------------------------------------------------
gaierror                                  Traceback (most recent call last)
~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
    156             conn = connection.create_connection(
--> 157                 (self._dns_host, self.port), self.timeout, **extra_kw
    158             )

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     60 
---> 61     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
     62         af, socktype, proto, canonname, sa = res

~/opt/anaconda3/envs/joseml/lib/python3.7/socket.py in getaddrinfo(host, port, family, type, proto, flags)
    751     addrlist = []
--> 752     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    753         af, socktype, proto, canonname, sa = res

gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    671                 headers=headers,
--> 672                 chunked=chunked,
    673             )

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    386         else:
--> 387             conn.request(method, url, **httplib_request_kw)
    388 

~/opt/anaconda3/envs/joseml/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1251         """Send a complete request to the server."""
-> 1252         self._send_request(method, url, body, headers, encode_chunked)
   1253 

~/opt/anaconda3/envs/joseml/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
   1297             body = _encode(body, 'body')
-> 1298         self.endheaders(body, encode_chunked=encode_chunked)
   1299 

~/opt/anaconda3/envs/joseml/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked)
   1246             raise CannotSendHeader()
-> 1247         self._send_output(message_body, encode_chunked=encode_chunked)
   1248 

~/opt/anaconda3/envs/joseml/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked)
   1025         del self._buffer[:]
-> 1026         self.send(msg)
   1027 

~/opt/anaconda3/envs/joseml/lib/python3.7/http/client.py in send(self, data)
    965             if self.auto_open:
--> 966                 self.connect()
    967             else:

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/connection.py in connect(self)
    183     def connect(self):
--> 184         conn = self._new_conn()
    185         self._prepare_conn(conn)

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
    168             raise NewConnectionError(
--> 169                 self, "Failed to establish a new connection: %s" % e
    170             )

NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fe048a89210>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    448                     retries=self.max_retries,
--> 449                     timeout=timeout
    450                 )

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    719             retries = retries.increment(
--> 720                 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
    721             )

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    435         if new_retry.is_exhausted():
--> 436             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    437 

MaxRetryError: HTTPConnectionPool(host='x86_64-apple-darwin13.4.0', port=8050): Max retries exceeded with url: /_alive_2a68c328-4238-4074-9318-c06fab6af9b2 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe048a89210>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
<ipython-input-6-65152495066a> in <module>
      1 # Run app and display result inline in the notebook
      2 #app.run_server(mode='inline')
----> 3 app.run_server()

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/jupyter_dash/jupyter_app.py in run_server(self, mode, width, height, inline_exceptions, **kwargs)
    292                 )
    293 
--> 294         wait_for_app()
    295 
    296         if mode == 'inline':

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py in wrapped_f(*args, **kw)
     47             @six.wraps(f)
     48             def wrapped_f(*args, **kw):
---> 49                 return Retrying(*dargs, **dkw).call(f, *args, **kw)
     50 
     51             return wrapped_f

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py in call(self, fn, *args, **kwargs)
    210                 if not self._wrap_exception and attempt.has_exception:
    211                     # get() on an attempt with an exception should cause it to be raised, but raise just in case
--> 212                     raise attempt.get()
    213                 else:
    214                     raise RetryError(attempt)

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py in get(self, wrap_exception)
    245                 raise RetryError(self)
    246             else:
--> 247                 six.reraise(self.value[0], self.value[1], self.value[2])
    248         else:
    249             return self.value

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/six.py in reraise(tp, value, tb)
    701             if value.__traceback__ is not tb:
    702                 raise value.with_traceback(tb)
--> 703             raise value
    704         finally:
    705             value = None

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py in call(self, fn, *args, **kwargs)
    198         while True:
    199             try:
--> 200                 attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    201             except:
    202                 tb = sys.exc_info()

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/jupyter_dash/jupyter_app.py in wait_for_app()
    280         )
    281         def wait_for_app():
--> 282             res = requests.get(alive_url).content.decode()
    283             if res != "Alive":
    284                 url = "http://{host}:{port}".format(

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/requests/api.py in get(url, params, **kwargs)
     74 
     75     kwargs.setdefault('allow_redirects', True)
---> 76     return request('get', url, params=params, **kwargs)
     77 
     78 

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/requests/api.py in request(method, url, **kwargs)
     59     # cases, and look like a memory leak in others.
     60     with sessions.Session() as session:
---> 61         return session.request(method=method, url=url, **kwargs)
     62 
     63 

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    528         }
    529         send_kwargs.update(settings)
--> 530         resp = self.send(prep, **send_kwargs)
    531 
    532         return resp

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
    641 
    642         # Send the request
--> 643         r = adapter.send(request, **kwargs)
    644 
    645         # Total elapsed time of the request (approximately)

~/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    514                 raise SSLError(e, request=request)
    515 
--> 516             raise ConnectionError(e, request=request)
    517 
    518         except ClosedPoolError as e:

ConnectionError: HTTPConnectionPool(host='x86_64-apple-darwin13.4.0', port=8050): Max retries exceeded with url: /_alive_2a68c328-4238-4074-9318-c06fab6af9b2 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe048a89210>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py", line 212, in call
    raise attempt.get()
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/six.py", line 703, in reraise
    raise value
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/jupyter_dash/jupyter_app.py", line 264, in run
    super_run_server(**kwargs)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/dash/dash.py", line 1615, in run_server
    self.server.run(host=host, port=port, debug=debug, **flask_run_options)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/werkzeug/serving.py", line 1052, in run_simple
    inner()
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/werkzeug/serving.py", line 1005, in inner
    fd=fd,
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/werkzeug/serving.py", line 848, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/site-packages/werkzeug/serving.py", line 740, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/http/server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/Users/andrea/opt/anaconda3/envs/joseml/lib/python3.7/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

I hope you can help me. The ones above are the packages in my working environment, the server runs on the base environment, this one:

# packages in environment at /Users/andrea/opt/anaconda3:
#
# Name                    Version                   Build  Channel
_anaconda_depends         2020.02                  py37_0  
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
aiohttp                   3.6.2            py37h0b31af3_0    conda-forge
alabaster                 0.7.12                   py37_0  
anaconda                  custom                   py37_1  
anaconda-client           1.7.2                    py37_0  
anaconda-navigator        1.9.12                   py37_0  
anaconda-project          0.8.4                      py_0  
ansi2html                 1.5.2            py37hc8dfbb8_1    conda-forge
applaunchservices         0.2.1                      py_0  
appnope                   0.1.0                    py37_0  
appscript                 1.1.0            py37h1de35cc_0  
argh                      0.26.2                   py37_0  
asn1crypto                1.3.0                    py37_0  
astroid                   2.4.0                    py37_0  
astropy                   4.0.1.post1      py37h1de35cc_0  
async-timeout             3.0.1                   py_1000    conda-forge
atomicwrites              1.4.0                      py_0  
attrs                     19.3.0                     py_0  
autopep8                  1.4.4                      py_0  
babel                     2.8.0                      py_0  
backcall                  0.1.0                    py37_0  
backports                 1.0                        py_2  
backports.functools_lru_cache 1.6.1                      py_0  
backports.shutil_get_terminal_size 1.0.0                    py37_2  
backports.tempfile        1.0                        py_1  
backports.weakref         1.0.post1                  py_1  
beautifulsoup4            4.9.0                    py37_0  
binutils                  1.0.1                         0    conda-forge
bitarray                  1.2.1            py37h1de35cc_0  
bkcharts                  0.2                      py37_0  
blas                      1.0                         mkl  
bleach                    3.1.4                      py_0  
blosc                     1.16.3               hd9629dc_0  
bokeh                     2.0.2                    py37_0  
boto                      2.49.0                   py37_0  
bottleneck                1.3.2            py37h776bbcc_0  
brotlipy                  0.7.0           py37h9bfed18_1000    conda-forge
bzip2                     1.0.8                h1de35cc_0  
c-compiler                1.0.1                h1de35cc_0    conda-forge
ca-certificates           2020.6.20            hecda079_0    conda-forge
cctools                   895                           1  
certifi                   2020.6.20        py37hc8dfbb8_0    conda-forge
cffi                      1.14.0           py37hb5b8e2f_0  
chardet                   3.0.4                 py37_1003  
clang                     4.0.1                         1  
clang_osx-64              4.0.1               h1ce6c1d_18  
clangxx                   4.0.1                         1  
clangxx_osx-64            4.0.1               h22b1bf0_18  
click                     7.1.2                      py_0  
cloudpickle               1.4.1                      py_0  
clyent                    1.2.2                    py37_1  
colorama                  0.4.3                      py_0  
compiler-rt               4.0.1                hcfea43d_1  
compilers                 1.0.1                         0    conda-forge
conda                     4.8.3            py37hc8dfbb8_1    conda-forge
conda-build               3.18.11                  py37_0  
conda-env                 2.6.0                         1  
conda-package-handling    1.6.1            py37h1de35cc_0  
conda-verify              3.4.2                      py_1  
contextlib2               0.6.0.post1                py_0  
cryptography              2.9.2            py37ha12b0ac_0  
curl                      7.69.1               ha441bb4_0  
cxx-compiler              1.0.1                h04f5b5a_0    conda-forge
cycler                    0.10.0                   py37_0  
cython                    0.29.17          py37h0a44026_0  
cytoolz                   0.10.1           py37h1de35cc_0  
dash                      1.13.3             pyh9f0ad1d_0    conda-forge
dash-core-components      1.10.1             pyh9f0ad1d_0    conda-forge
dash-html-components      1.0.3              pyh9f0ad1d_0    conda-forge
dash-renderer             1.5.0              pyh9f0ad1d_0    conda-forge
dash-table                4.8.1              pyh9f0ad1d_0    conda-forge
dask                      2.16.0                     py_0  
dask-core                 2.16.0                     py_0  
dbus                      1.13.14              h517e14e_0  
decorator                 4.4.2                      py_0  
defusedxml                0.6.0                      py_0  
diff-match-patch          20181111                   py_0  
distributed               2.16.0                   py37_0  
docutils                  0.16                     py37_0  
entrypoints               0.3                      py37_0  
et_xmlfile                1.0.1                    py37_0  
expat                     2.2.6                h0a44026_0  
fastcache                 1.1.0            py37h1de35cc_0  
filelock                  3.0.12                     py_0  
flake8                    3.7.9                    py37_0  
flask                     1.1.2                      py_0  
flask-compress            1.5.0              pyh9f0ad1d_0    conda-forge
fortran-compiler          1.0.1                h4f947d3_0    conda-forge
freetype                  2.9.1                hb4e5f40_0  
fsspec                    0.7.1                      py_0  
future                    0.18.2                   py37_0  
get_terminal_size         1.0.0                h7520d66_0  
gettext                   0.19.8.1             h15daf44_3  
gevent                    1.4.0            py37h1de35cc_0  
gfortran_osx-64           4.8.5                h22b1bf0_8  
glib                      2.63.1               hd977a24_0  
glob2                     0.7                        py_0  
gmp                       6.1.2                hb37e062_1  
gmpy2                     2.0.8            py37h6ef4df4_2  
greenlet                  0.4.15           py37h1de35cc_0  
h5py                      2.10.0           py37h3134771_0  
hdf5                      1.10.4               hfa1e0ec_0  
heapdict                  1.0.1                      py_0  
html5lib                  1.0.1                    py37_0  
hupper                    1.8.1                    py37_0  
hypothesis                5.11.0                     py_0  
icu                       58.2                 h0a44026_3  
idna                      2.9                        py_1  
imageio                   2.8.0                      py_0  
imagesize                 1.2.0                      py_0  
importlib_metadata        1.5.0                    py37_0  
intel-openmp              2019.4                      233  
intervaltree              3.0.2                      py_0  
ipykernel                 5.1.4            py37h39e3cac_0  
ipython                   7.13.0           py37h5ca1d4c_0  
ipython_genutils          0.2.0                    py37_0  
ipywidgets                7.5.1                      py_0  
isort                     4.3.21                   py37_0  
itsdangerous              1.1.0                    py37_0  
jbig                      2.1                  h4d881f8_0  
jdcal                     1.4.1                      py_0  
jedi                      0.15.2                   py37_0  
jinja2                    2.11.2                     py_0  
joblib                    0.14.1                     py_0  
jpeg                      9b                   he5867d9_2  
json5                     0.9.4                      py_0  
jsonschema                3.2.0                    py37_0  
jupyter                   1.0.0                    py37_7  
jupyter-dash              0.2.1.post1                py_0    plotly
jupyter-server-proxy      1.5.0                      py_0    conda-forge
jupyter_client            6.1.3                      py_0  
jupyter_console           6.1.0                      py_0  
jupyter_core              4.6.3                    py37_0  
jupyterlab                2.0.1                      py_0    conda-forge
jupyterlab_server         1.1.1                      py_0  
kaggle                    1.5.6                    pypi_0    pypi
keyring                   21.1.1                   py37_2  
kiwisolver                1.2.0            py37h04f5b5a_0  
krb5                      1.17.1               hddcf347_0  
lazy-object-proxy         1.4.3            py37h1de35cc_0  
ld64                      274.2                         1  
libarchive                3.3.3                h786848e_5  
libcurl                   7.69.1               h051b688_0  
libcxx                    4.0.1                hcfea43d_1  
libcxxabi                 4.0.1                hcfea43d_1  
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.2.1                h0a44026_6  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.16                 h1de35cc_0  
liblief                   0.10.1               h0a44026_0  
libpng                    1.6.37               ha441bb4_0  
libsodium                 1.0.16               h3efe00b_0  
libspatialindex           1.9.3                h0a44026_0  
libssh2                   1.9.0                ha12b0ac_1  
libtiff                   4.1.0                hcb84e12_0  
libxml2                   2.9.9                hf6e021a_1  
libxslt                   1.1.33               h33a18ac_0  
llvm                      4.0.1                         1  
llvm-lto-tapi             4.0.1                         1  
llvm-openmp               4.0.1                hcfea43d_1  
llvmlite                  0.32.1           py37h8c7ce04_0  
locket                    0.2.0                    py37_1  
lxml                      4.5.0            py37hef8c89e_0  
lz4-c                     1.8.1.2              h1de35cc_0  
lzo                       2.10                 h1de35cc_2  
markupsafe                1.1.1            py37h1de35cc_0  
matplotlib                3.1.3                    py37_0  
matplotlib-base           3.1.3            py37h9aa3819_0  
mccabe                    0.6.1                    py37_1  
mistune                   0.8.4            py37h1de35cc_0  
mkl                       2019.4                      233  
mkl-service               2.3.0            py37hfbe908c_0  
mkl_fft                   1.0.15           py37h5e564d8_0  
mkl_random                1.1.0            py37ha771720_0  
mock                      4.0.2                      py_0  
more-itertools            8.2.0                      py_0  
mpc                       1.1.0                h6ef4df4_1  
mpfr                      4.0.1                h3018a27_3  
mpmath                    1.1.0                    py37_0  
msgpack-python            1.0.0            py37h04f5b5a_1  
multidict                 4.7.5            py37h9bfed18_1    conda-forge
multipledispatch          0.6.0                    py37_0  
navigator-updater         0.2.1                    py37_0  
nbconvert                 5.6.1                    py37_0  
nbformat                  5.0.6                      py_0  
ncurses                   6.2                  h0a44026_1  
networkx                  2.4                        py_0  
nltk                      3.4.5                    py37_0  
nodejs                    10.13.0              h0a44026_0  
nose                      1.3.7                    py37_2  
notebook                  6.0.3                    py37_0  
numba                     0.49.0           py37h6c726b0_0  
numexpr                   2.7.1            py37hce01a72_0  
numpy                     1.18.1           py37h7241aed_0  
numpy-base                1.18.1           py37h6575580_1  
numpydoc                  0.9.2                      py_0  
olefile                   0.46                     py37_0  
openpyxl                  3.0.3                      py_0  
openssl                   1.1.1g               h0b31af3_0    conda-forge
packaging                 20.3                       py_0  
pandas                    1.0.3            py37h6c726b0_0  
pandoc                    2.2.3.2                       0  
pandocfilters             1.4.2                    py37_1  
parso                     0.5.2                      py_0  
partd                     1.1.0                      py_0  
pastedeploy               2.0.1                    py37_0  
path                      13.1.0                   py37_0  
path.py                   12.4.0                        0  
pathlib2                  2.3.5                    py37_0  
pathtools                 0.1.2                      py_1  
patsy                     0.5.1                    py37_0  
pcre                      8.43                 h0a44026_0  
pep8                      1.7.1                    py37_0  
pexpect                   4.8.0                    py37_0  
pickleshare               0.7.5                    py37_0  
pillow                    7.1.2            py37h4655f20_0  
pip                       20.0.2                   py37_3  
pkginfo                   1.5.0.1                  py37_0  
plaster                   1.0                      py37_1  
plaster_pastedeploy       0.7                      py37_0  
plotly                    4.8.1              pyh9f0ad1d_0    conda-forge
pluggy                    0.13.1                   py37_0  
ply                       3.11                     py37_0  
prometheus_client         0.7.1                      py_0  
prompt-toolkit            3.0.4                      py_0  
prompt_toolkit            3.0.4                         0  
psutil                    5.7.0            py37h1de35cc_0  
ptyprocess                0.6.0                    py37_0  
py                        1.8.1                      py_0  
py-lief                   0.10.1           py37haf313ee_0  
pycodestyle               2.5.0                    py37_0  
pycosat                   0.6.3            py37h1de35cc_0  
pycparser                 2.20                       py_0  
pycrypto                  2.6.1            py37h1de35cc_9  
pycurl                    7.43.0.5         py37ha12b0ac_0  
pydocstyle                4.0.1                      py_0  
pyflakes                  2.1.1                    py37_0  
pygments                  2.6.1                      py_0  
pylint                    2.5.0                    py37_1  
pyodbc                    4.0.30           py37h0a44026_0  
pyopenssl                 19.1.0                   py37_0  
pyparsing                 2.4.7                      py_0  
pyqt                      5.9.2            py37h655552a_2  
pyramid                   1.10.4                   py37_0    anaconda
pyrsistent                0.16.0           py37h1de35cc_0  
pysocks                   1.7.1                    py37_0  
pytables                  3.6.1            py37h5bccee9_0  
pytest                    5.4.1                    py37_0  
pytest-arraydiff          0.3              py37h39e3cac_0  
pytest-astropy            0.8.0                      py_0  
pytest-astropy-header     0.1.2                      py_0  
pytest-doctestplus        0.5.0                      py_0  
pytest-openfiles          0.5.0                      py_0  
pytest-remotedata         0.3.2                    py37_0  
python                    3.7.6                h359304d_2  
python-dateutil           2.8.1                      py_0  
python-jsonrpc-server     0.3.4                      py_0  
python-language-server    0.31.10                  py37_0  
python-libarchive-c       2.9                        py_0  
python-slugify            4.0.0                    pypi_0    pypi
python.app                2                       py37_10  
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2020.1                     py_0  
pywavelets                1.1.1            py37h1de35cc_0  
pyyaml                    5.3.1            py37h1de35cc_0  
pyzmq                     18.1.1           py37h0a44026_0  
qdarkstyle                2.8.1                      py_0  
qt                        5.9.7                h468cd18_1  
qtawesome                 0.7.0                      py_0  
qtconsole                 4.7.4                      py_0  
qtpy                      1.9.0                      py_0  
readline                  7.0                  h1de35cc_5  
requests                  2.23.0                   py37_0  
requests-futures          1.0.0                    py37_0  
retrying                  1.3.3                      py_2    conda-forge
ripgrep                   11.0.2               he32d670_0  
rope                      0.17.0                     py_0  
rtree                     0.9.4                    py37_1  
ruamel_yaml               0.15.87          py37h1de35cc_0  
scikit-image              0.16.2           py37h6c726b0_0  
scikit-learn              0.22.1           py37h27c97d8_0  
scipy                     1.4.1            py37h9fa6033_0  
seaborn                   0.10.1                     py_0  
send2trash                1.5.0                    py37_0  
setuptools                46.1.3                   py37_0  
simpervisor               0.3                        py_1    conda-forge
simplegeneric             0.8.1                    py37_2  
singledispatch            3.4.0.3                  py37_0  
sip                       4.19.8           py37h0a44026_0  
six                       1.14.0                   py37_0  
snappy                    1.1.7                he62c110_3  
snowballstemmer           2.0.0                      py_0  
sortedcollections         1.1.2                    py37_0  
sortedcontainers          2.1.0                    py37_0  
soupsieve                 2.0                        py_0  
sphinx                    3.0.3                      py_0  
sphinxcontrib             1.0                      py37_1  
sphinxcontrib-applehelp   1.0.2                      py_0  
sphinxcontrib-devhelp     1.0.2                      py_0  
sphinxcontrib-htmlhelp    1.0.3                      py_0  
sphinxcontrib-jsmath      1.0.1                      py_0  
sphinxcontrib-qthelp      1.0.3                      py_0  
sphinxcontrib-serializinghtml 1.1.4                      py_0  
sphinxcontrib-websupport  1.2.1                      py_0  
spyder                    4.1.3                    py37_0  
spyder-kernels            1.9.1                    py37_0  
sqlalchemy                1.3.16           py37h1de35cc_0  
sqlite                    3.31.1               h5c1f38d_1  
statsmodels               0.11.0           py37h1de35cc_0  
sympy                     1.5.1                    py37_0  
tbb                       2020.0               h04f5b5a_0  
tblib                     1.6.0                      py_0  
terminado                 0.8.3                    py37_0  
testpath                  0.4.4                      py_0  
text-unidecode            1.3                      pypi_0    pypi
tk                        8.6.8                ha441bb4_0  
toml                      0.10.0           py37h28b3542_0  
toolz                     0.10.0                     py_0  
tornado                   6.0.4            py37h1de35cc_1  
tqdm                      4.46.0                     py_0  
traitlets                 4.3.3                    py37_0  
translationstring         1.3                      py37_1  
typed-ast                 1.4.1            py37h1de35cc_0  
typing_extensions         3.7.4.1                  py37_0  
ujson                     1.35             py37h1de35cc_0  
unicodecsv                0.14.1                   py37_0  
unixodbc                  2.3.7                h1de35cc_0  
urllib3                   1.24.3                   pypi_0    pypi
venusian                  1.2.0                    py37_0  
watchdog                  0.10.2           py37h1de35cc_0  
wcwidth                   0.1.9                      py_0  
webencodings              0.5.1                    py37_1  
webob                     1.8.6                      py_0  
werkzeug                  1.0.1                      py_0  
wheel                     0.34.2                   py37_0  
widgetsnbextension        3.5.1                    py37_0  
wrapt                     1.11.2           py37h1de35cc_0  
wurlitzer                 2.0.0                    py37_0  
xlrd                      1.2.0                    py37_0  
xlsxwriter                1.2.8                      py_0  
xlwings                   0.19.0                   py37_0  
xlwt                      1.3.0                    py37_0  
xmltodict                 0.12.0                     py_0  
xz                        5.2.5                h1de35cc_0  
yaml                      0.1.7                hc338f04_2  
yapf                      0.28.0                     py_0  
yarl                      1.3.0           py37h0b31af3_1000    conda-forge
zeromq                    4.3.1                h0a44026_3  
zict                      2.0.0                      py_0  
zipp                      3.1.0                      py_0  
zlib                      1.2.11               h1de35cc_3  
zope                      1.0                      py37_1  
zope.deprecation          4.4.0                    py37_0  
zope.interface            4.7.1            py37h1de35cc_0  
zstd                      1.3.7                h5bba6e5_0  

It looks like the error is with dash itself, since when I run the code from VSCode I got the following error:

Dash is running on http://x86_64-apple-darwin13.4.0:8050/

 Warning: This is a development server. Do not use app.run_server
 in production, use a production WSGI server like gunicorn instead.

 * Serving Flask app "layout2" (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: off
Traceback (most recent call last):
  File "/Users/andrea/Desktop/layout2.py", line 51, in <module>
    app.run_server()
  File "/Users/andrea/opt/anaconda3/lib/python3.7/site-packages/dash/dash.py", line 1615, in run_server
    self.server.run(host=host, port=port, debug=debug, **flask_run_options)
  File "/Users/andrea/opt/anaconda3/lib/python3.7/site-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/Users/andrea/opt/anaconda3/lib/python3.7/site-packages/werkzeug/serving.py", line 1052, in run_simple
    inner()
  File "/Users/andrea/opt/anaconda3/lib/python3.7/site-packages/werkzeug/serving.py", line 1005, in inner
    fd=fd,
  File "/Users/andrea/opt/anaconda3/lib/python3.7/site-packages/werkzeug/serving.py", line 848, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "/Users/andrea/opt/anaconda3/lib/python3.7/site-packages/werkzeug/serving.py", line 740, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "/Users/andrea/opt/anaconda3/lib/python3.7/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/Users/andrea/opt/anaconda3/lib/python3.7/http/server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/Users/andrea/opt/anaconda3/lib/python3.7/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

SOLVED Dash uses a weird hostname. I just added that name to /etc/hosts and now it works.

jonmmease commented 4 years ago

Thanks @adalseno, for the benefit of others would you mind share the entry that you added to /etc/hosts to get things working (anonymizing whatever values you'd like of course)? Thanks!

adalseno commented 4 years ago

The code to add to /etc/hosts is as follows (you must use sudo to update that file):

# Added for dash on python-jupyter
127.0.0.1   x86_64-apple-darwin13.4.0

The name may vary depending on you environment but if you start Dash from a python script it will output the name to use like this: Dash is running on http://x86_64-apple-darwin13.4.0:8050/

ra1111 commented 4 years ago

@adalseno Thanks your solution works like a charm!

elzerac commented 4 years ago

If you don't have sudo priviledges and are running remotely, I was able to just specify host name: app.run_server(mode="inline", host = "localhost")

dhirschfeld commented 3 years ago

In JupyterLab running under JupyterHub on AKS I was getting:

socket.gaierror: [Errno -3] Temporary failure in name resolution ```python-traceback ConnectionError: HTTPConnectionPool(host='x86_64-conda-linux-gnu', port=8050): Max retries exceeded with url: /_alive_4af21c1b-0054-433b-9d47-1e11b1c0143e (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Exception in thread Thread-18: Traceback (most recent call last): File "/opt/conda/envs/quantdev/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/opt/conda/envs/quantdev/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/retrying.py", line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/retrying.py", line 212, in call raise attempt.get() File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/six.py", line 719, in reraise raise value File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/retrying.py", line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/jupyter_dash/jupyter_app.py", line 289, in run super_run_server(**kwargs) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/dash/dash.py", line 1750, in run_server self.server.run(host=host, port=port, debug=debug, **flask_run_options) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/flask/app.py", line 922, in run run_simple(t.cast(str, host), port, self, **options) File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/werkzeug/serving.py", line 1008, in run_simple inner() File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/werkzeug/serving.py", line 957, in inner fd=fd, File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/werkzeug/serving.py", line 781, in make_server host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd File "/opt/conda/envs/quantdev/lib/python3.7/site-packages/werkzeug/serving.py", line 686, in __init__ super().__init__(server_address, handler) # type: ignore File "/opt/conda/envs/quantdev/lib/python3.7/socketserver.py", line 452, in __init__ self.server_bind() File "/opt/conda/envs/quantdev/lib/python3.7/http/server.py", line 137, in server_bind socketserver.TCPServer.server_bind(self) File "/opt/conda/envs/quantdev/lib/python3.7/socketserver.py", line 466, in server_bind self.socket.bind(self.server_address) socket.gaierror: [Errno -3] Temporary failure in name resolution ```

After changing to app.run_server(mode="inline", host = "localhost") I then got a "localhost refused to connect" error:

image

Edit: Calling _send_jupyter_config_comm_request before importing JupyterDash fixed that problem so it now works for me! :tada:

AncilaMoideen commented 2 years ago

HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /get_training_data?submitted_by=admin&status=NF (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000027F368E0700>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

@adalseno I am facing this error in visual studio, What should I do to resolve this error??