Embedding IPython Qt console in a PyQt application解决了这个问题,但最新的答案来自2014年。显然事情已经发生了变化,因为以下代码会发出警告:
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
给出:
local/lib/python2.7/site-packages/IPython/qt.py:13: ShimWarning: The `IPython.qt` package has been deprecated. You should import from qtconsole instead.
但QtInProcessKernelManager
仅出现在IPython.qt.inprocess
中。
在PyQt应用程序中嵌入IPython Qt控制台的不推荐方法是什么?
答案 0 :(得分:0)
您的导入现在应该如下所示:
from qtconsole.inprocess import QtInProcessKernelManager
from qtconsole.rich_jupyter_widget import RichJupyterWidget
有关完整示例,请查看项目github:https://github.com/jupyter/qtconsole/blob/master/examples/inprocess_qtconsole.py
中的示例有关更多一般信息,您需要查看Project Jupyter website和/或在ipython上执行一些搜索 - > jupyter过渡。