Como instalar corretamente o IPython no Ubuntu 15.10?

2

Eu instalei o IPython usando

sudo apt-get install ipython ipython-notebook

Mas quando tentei iniciá-lo, ele se queixa de não encontrar alguns componentes:

sudo ipython notebook
Traceback (most recent call last):
  File "/usr/bin/ipython", line 5, in <module>
    start_ipython()
  File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 564, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-110>", line 2, in initialize
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 92, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 321, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 92, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/core/application.py", line 381, in initialize
    self.parse_command_line(argv)
  File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 316, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<decorator-gen-4>", line 2, in parse_command_line
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 92, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 475, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<decorator-gen-3>", line 2, in initialize_subcommand
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 92, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 406, in initialize_subcommand
    subapp = import_item(subapp)
  File "/usr/lib/python2.7/dist-packages/IPython/utils/importstring.py", line 42, in import_item
    module = __import__(package, fromlist=[obj])
  File "/usr/lib/python2.7/dist-packages/IPython/html/notebookapp.py", line 62, in <module>
    from tornado import httpserver
  File "/usr/local/lib/python2.7/dist-packages/tornado/httpserver.py", line 34, in <module>
    from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
  File "/usr/local/lib/python2.7/dist-packages/tornado/http1connection.py", line 28, in <module>
    from tornado import gen
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 97, in <module>
    from singledispatch import singledispatch  # backport
ImportError: No module named singledispatch

Informação da versão:

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.10
DISTRIB_CODENAME=wily
DISTRIB_DESCRIPTION="Ubuntu 15.10"
    
por qazwsx 15.03.2016 / 20:45

1 resposta

4

Instalando o ipython notebook com:

sudo apt-get install ipython ipython-notebook

instalará automaticamente python-tornado em todo o sistema (é uma dependência obrigatória, consulte link )

Você tem o problema de importação de singledispatch porque também instalou manualmente uma versão de tornado em /usr/local/lib/python2.7/dist-packages/tornado .

Tente remover a versão do culpado com:

sudo rm -rf /usr/local/lib/python2.7/dist-packages/tornado
    
por Sylvain Pineau 15.03.2016 / 22:12