python - 安装新模块后 IPython 内核重新启动

标签 python ipython

在安装一些新的第三方模块和“笔记本”后,我将“ipython”与“qtconsole”一起使用(它工作完美),它停止工作并且内核不断重新启动。

错误在这里:

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

如何解决这个问题? 错误显示“请参阅插入 URL 以获取更多详细信息。”我在哪里可以找到这个“插入网址”??? 谢谢。

最佳答案

您安装了多个版本的 IPython,并且它变得困惑。 /usr/lib 中的版本是使用 apt 安装的,并且是旧版本(1.0 之前的版本)。

最短的解决方法(如果您可以使用)是apt-get remove ipython,在您的系统上只留下一个 IPython。

这个问题最可能的原因easy_install,因为您说它是由安装另一个软件包引起的。当您已经使用 apt 安装了软件包时,easy_install 可能会错误地将 dist-packages 添加到 easy-install.pth 中。要检查这一点,请查看文件(如果存在):

~/.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 开头的条目,则应将其删除。

关于python - 安装新模块后 IPython 内核重新启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22515241/

相关文章:

python - pydev/python 中的 "Undefined variable : main"

python - 如何在 marqo 中添加搜索文档

python - 使用具有多种数据类型的索引列表对 Pandas 系列对象进行切片

python - 将多索引数据帧拆分为 pandas 中的平面数据帧

python - 将 HTML Ipython 对象输出到磁盘

jupyter-notebook - 在 IPython 中混合 shell 变量和 python 变量 '!command'

python - 如何按大小写降序排列?

python - 处理同一实体的多个实例和状态

python - 在 pyspark 中运行脚本时缺少应用程序资源

python - 如何检查 iPython 中对象的内存使用情况?