1
votes

my ipython notebook functionality stop working. If I do

ipython notebook

the console just hangs forever with no debug output. I have already tried reinstalling ipython but no success. Also, if I start normal ipython everything seems fine.

Does anybody have a clue how to solve this? I suspect some lock file is still there but how can I find out what is exactly going wrong?

also if I force interrupt I get the following stack trace

^C^CTraceback (most recent call last):
  File "/home/lfiaschi/anaconda/bin/ipython", line 9, in <module>
    load_entry_point('ipython==1.2.1', 'console_scripts', 'ipython')()
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/__init__.py", line 118, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 544, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 312, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/core/application.py", line 373, in initialize
    self.parse_command_line(argv)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 307, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 474, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 405, in initialize_subcommand
    subapp = import_item(subapp)
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/utils/importstring.py", line 42, in import_item
    module = __import__(package, fromlist=[obj])
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 64, in <module>
    from .services.kernels.kernelmanager import MappingKernelManager
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/html/services/kernels/kernelmanager.py", line 21, in <module>
    from IPython.kernel.multikernelmanager import MultiKernelManager
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/kernel/__init__.py", line 6, in <module>
    from .connect import *
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/kernel/connect.py", line 39, in <module>
    from IPython.utils.localinterfaces import LOCALHOST
  File "/home/lfiaschi/anaconda/lib/python2.7/site-packages/IPython/utils/localinterfaces.py", line 43, in <module>
    PUBLIC_IPS = socket.gethostbyname_ex(socket.gethostname() + '.local')[2]
KeyboardInterrupt
1
Also changing the default browser does not help - Luca Fiaschi
even ipython notebook --debug freezes and does not offer any insight - Luca Fiaschi
There is something peculiar in your network configuration. What are socket.gethostname() and socket.gethostbyname_ex(socket.gethostname()) and socket.gethostbyname_ex(socket.gethostname() + '.local')? - minrk
make sure your /etc/hostname is something reasonable, and not localhost.localdomain, then make sure that name is used in /etc/hosts file for 127.0.0.1 - dashesy

1 Answers

0
votes

I had the same problem in Linux/Ubuntu. This also hanged spyder.

Workaround for me:

(1) Look at host name of computer

cat /etc/hostname

which gives e.g. my-laptop

(2) Ensure that /etc/hosts contains the following entry

127.0.0.1     my-laptop     my-laptop.local

because ipython looks for a 'local' extension too.

And fire up again ipython notebook or spyder. This worked for me for spyder, when it was hanging at:

PUBLIC_IPS = socket.gethostbyname_ex(socket.gethostname() + '.local')[2]