title: Launching Jupyter Notebook on localhost results in '[Errno 49] Can't assign requested address', however ip=127.0.0.1 works
body: <p>When attempting to launch a Jupyter Notebook I get the following error</p>
  
  <pre><code>$ Jupyter Notebook
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-notebook", line 11, in &lt;module&gt;
      sys.exit(main())
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/jupyter_core/application.py", line 268, in launch_instance
      return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/traitlets/config/application.py", line 663, in launch_instance
      app.initialize(argv)
    File "&lt;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/decorator.py:decorator-gen-7&gt;", line 2, in initialize
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
      return method(app, *args, **kwargs)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/notebook/notebookapp.py", line 1720, in initialize
      self.init_webapp()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/notebook/notebookapp.py", line 1482, in init_webapp
      self.http_server.listen(port, self.ip)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tornado/tcpserver.py", line 151, in listen
      sockets = bind_sockets(port, address=address)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tornado/netutil.py", line 174, in bind_sockets
      sock.bind(sockaddr)
  OSError: [Errno 49] Can't assign requested address
  </code></pre>
  
  <p>However, when I specify the ip address of 127.0.0.1 (i.e. not 'localhost'), <code>Jupyter Notebook --ip=127.0.0.1</code> it works perfectly fine.</p>
  
  <p>Also, when I ping localhost it returns that local host is in fact 127.0.0.1.</p>
  
  <pre><code>$ ping localhost
  PING localhost.localdomain (127.0.0.1): 56 data bytes
  64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.034 ms
  </code></pre>
  
  <p>I've checked both etc/hosts and private/etc/hosts, and neither specify a localhost (or anything for that matter).</p>
  
  <p>I am trying to fix this issue as I run Jupyter Notebooks in PyCharm and you can't create a simple shortcut to just run on 127.0.0.1 vice 'localhost'. (No simple shortcut I'm aware of, correct me if I'm wrong)  I can launch on 127.0.0.1 in Pycharm, but it takes multiple steps and is burdensome.  I just want this to work via its intended configuration of 'localhost' as the default.</p>