1

I installed Anaconda python distribution. However, after executing "ipython notebook" I am not able to execute it successfully and system yields the following error. I am clueless, what has went wrong ?

Thanks.

AbhayBhadani-MacBook:~ abhaybhadani$ ipython --version

3.0.0

AbhayBhadani-MacBook:~ abhaybhadani$ which ipython

/opt/anaconda/bin/ipython

AbhayBhadani-MacBook:~ abhaybhadani$ ipython notebook

[I 11:25:33.829 NotebookApp] Using existing profile dir: u'/Users/abhaybhadani/.ipython/profile_default'

[I 11:25:33.833 NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
Traceback (most recent call last):

  File "/opt/anaconda/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 573, in launch_instance
    app.initialize(argv)

  File "<string>", line 2, in initialize

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 321, in initialize
    super(TerminalIPythonApp, self).initialize(argv)

  File "<string>", line 2, in initialize

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/core/application.py", line 369, in initialize
    self.parse_command_line(argv)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 316, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)

  File "<string>", line 2, in parse_command_line

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 471, in parse_command_line
    return self.initialize_subcommand(subc, subargv)

  File "<string>", line 2, in initialize_subcommand

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 409, in initialize_subcommand
    self.subapp.initialize(argv)

  File "<string>", line 2, in initialize

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 980, in initialize
    self.init_webapp()

  File "/opt/anaconda/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 842, in init_webapp
    self.http_server.listen(port, self.ip)

  File "/opt/anaconda/lib/python2.7/site-packages/tornado/tcpserver.py", line 125, in listen
    sockets = bind_sockets(port, address=address)

  File "/opt/anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 145, in bind_sockets
    sock.bind(sockaddr)

  File "/opt/anaconda/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)

error: [Errno 49] Can't assign requested address


If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]


You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.


Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True
4
  • Have you tried this: "If you suspect this is an IPython bug, please report it at: github.com/ipython/ipython/issues or send an email to the mailing list at [email protected]" ? Commented Mar 9, 2015 at 6:58
  • 1
    Anaconda doesn't install all notebook dependencies by default, IIRC: try conda install ipython-notebook to make sure. Commented Mar 9, 2015 at 9:43
  • Thanks Ian , I has installed conda update ipython ipython-notebook ipython-qtconsole. But, this error appeared after installing whole package. Commented Mar 9, 2015 at 15:57
  • 1
    I was able to solve this by simply typing: ipython notebook --ip=127.0.0.1 at the terminal :) Commented Mar 17, 2015 at 4:39

1 Answer 1

1

This is just building on the answer that @Abhay Bhadani already provided for himself, since I can't seem to find the root cause myself

You may try to edit your ipython profile. In my case I had to create a profile with the following command:

ipython profile create

then append the following line to the ipython notebook config. In my case that file is located at ~/.ipython/profile_default/ipython_notebook_config.py which is the default location for profiles that are created without a name. Once found, append the following config option:

c.NotebookApp.ip = '127.0.0.1'

then, when running ipython notebook, it will open as usual without the need to provide the ip argument. So not much of an improvement from your solution, but I prefer it that way :)

In the case that you're really interested in knowing why or what address is being called when not providing the ip in the config or on the command line you can append the following instead in the same config file:

c.Application.verbose_crash=True

In my case, running ipython notebook gives the following output:

--> 228     return getattr(self._sock,name)(*args)
    global getattr = undefined
    self._sock = <socket object, fd=6, family=2, type=1, protocol=6>
    name = 'bind'
    args = (('192.168.77.104', 8888),)
229
230 for _m in _socketmethods:
231     p = partial(meth,_m)
232     p.__name__ = _m
233     p.__doc__ = getattr(_realsocket,_m).__doc__
234     m = MethodType(p,None,_socketobject)
235     setattr(_socketobject,_m,m)
236
237 socket = SocketType = _socketobject
238
239 class _fileobject(object):
240     """Faux file object attached to a socket object."""
241
242     default_bufsize = 8192
243     name = "<socket>"

error: [Errno 49] Can't assign requested address

Which only gave me a hint that it might be trying to access an invalid IP.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.