安装新模块后IPython内核重启

2 投票
1 回答
584 浏览
提问于 2025-04-17 23:01

我之前在用“ipython”和“qtconsole”,它们配合得很好。但是在我安装了一些新的第三方模块后,“notebook”就开始出问题了,内核不停地重启。

错误信息在这里:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/IPython/kernel/__init__.py", line 10, in <module>
raise ImportError(__doc__)
ImportError: IPython.kernel has been replaced by IPython.parallel.

The previous version of IPython's parallel library was located at this
location (IPython.kernel). It has been moved to the IPython.parallel
subpackage and has been refactored to use zeromq/pyzmq instead of twisted.

Please see INSERT URL for further details.

[IPythonQtConsoleApp] WARNING | kernel restarted

我该怎么解决这个问题呢?错误信息上写着“请查看INSERT URL以获取更多详细信息。”这个“INSERT URL”在哪里可以找到呢?谢谢。

1 个回答

3

你电脑上安装了多个版本的IPython,这让它有点混乱。你在/usr/lib里的版本是通过apt安装的,而且是个旧版本(1.0之前的)。

如果你能这样做,最简单的解决办法就是运行apt-get remove ipython,这样就只会留下一个IPython在你的系统上。

你提到这个问题是因为安装了另一个软件包,最可能的原因是easy_install。有时候,easy_install会错误地把dist-packages添加到easy-install.pth里,而你已经用apt安装了一个包。要检查这个问题,可以看看这些文件(如果存在的话):

~/.local/lib/python2.7/site-packages/easy-install.pth
/usr/local/lib/python2.7/dist-packages/easy-install.pth

如果有任何以/usr/lib/python2.7/dist-packages开头的条目,应该把它们删除掉。

撰写回答