【问题标题】:What's the right way to get an iPython/Jupyter embedded Qt console?获得 iPython/Jupyter 嵌入式 Qt 控制台的正确方法是什么?
【发布时间】:2016-07-27 03:51:57
【问题描述】:

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 控制台的非弃用方式是什么?

【问题讨论】:

    标签: pyqt ipython jupyter


    【解决方案1】:

    您的导入现在应该如下所示:

    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 转换上执行一些搜索。

    【讨论】:

      猜你喜欢
      • 2012-07-15
      • 2014-08-29
      • 1970-01-01
      • 2011-05-18
      • 2012-03-14
      • 2016-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多