【问题标题】:Seemingly missing ipython module trying to use jupyter notebook with anaconda似乎缺少 ipython 模块试图将 jupyter notebook 与 anaconda 一起使用
【发布时间】:2016-11-11 22:36:06
【问题描述】:

打开 jupyter notebook 时,出现以下错误。知道如何解决这个问题吗?我正在使用 Anaconda 2 在 ubuntu 16.04 上运行。尝试卸载并重新安装 ipython 并尝试通过 pip 和 conda 执行此操作。没有帮助。

[E 13:52:02.191 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "/home/user/anaconda2/lib/python2.7/site-packages/notebook/base/handlers.py", line 457, in wrapper
        result = yield gen.maybe_future(method(self, *args, **kwargs))
      File "/home/user/anaconda2/lib/python2.7/site-packages/notebook/services/kernelspecs/handlers.py", line 56, in get
        for kernel_name in ksm.find_kernel_specs():
      File "/home/user/anaconda2/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 192, in find_kernel_specs
        kspecs = super(CondaKernelSpecManager, self).find_kernel_specs()
      File "/home/user/anaconda2/lib/python2.7/site-packages/jupyter_client/kernelspec.py", line 128, in find_kernel_specs
        for kernel_dir in self.kernel_dirs:
      File "/home/user/anaconda2/lib/python2.7/site-packages/traitlets/traitlets.py", line 554, in __get__
        return self.get(obj, cls)
      File "/home/user/anaconda2/lib/python2.7/site-packages/traitlets/traitlets.py", line 533, in get
        value = self._validate(obj, dynamic_default())
      File "/home/user/anaconda2/lib/python2.7/site-packages/jupyter_client/kernelspec.py", line 114, in _kernel_dirs_default
        from IPython.paths import get_ipython_dir
      File "/home/user/anaconda2/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
        from .core.application import Application
      File "/home/user/anaconda2/lib/python2.7/site-packages/IPython/core/application.py", line 25, in <module>
        from IPython.core import release, crashhandler
      File "/home/user/anaconda2/lib/python2.7/site-packages/IPython/core/crashhandler.py", line 28, in <module>
        from IPython.core import ultratb
      File "/home/user/anaconda2/lib/python2.7/site-packages/IPython/core/ultratb.py", line 131, in <module>
        import IPython.utils.colorable as colorable
    AttributeError: 'module' object has no attribute 'utils'
[E 13:52:02.192 NotebookApp] {
      "Accept-Language": "en-US,en;q=0.5", 
      "Accept-Encoding": "gzip, deflate", 
      "Host": "localhost:8888", 
      "Accept": "*/*", 
      "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0", 
      "Connection": "keep-alive", 
      "X-Requested-With": "XMLHttpRequest", 
      "Referer": "http://localhost:8888/tree"
    }
[E 13:52:02.192 NotebookApp] 500 GET /api/kernelspecs (127.0.0.1) 3.10ms referer=http://localhost:8888/tree

【问题讨论】:

  • ipython --version 显示什么?你最后尝试了哪个 pip 和 conda ?两者都使用会使事情变得一团糟。

标签: ipython anaconda jupyter


【解决方案1】:

卸载 Anaconda2 并安装 Anaconda3 解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-17
    • 2019-02-13
    • 1970-01-01
    • 1970-01-01
    • 2017-01-02
    相关资源
    最近更新 更多