UnknownBackend:在 emacs python 笔记本中启用内联 matplotlib 时,没有 u'inline' 的事件循环集成

2024-03-22

我正在尝试在 emacs 中启用 python 笔记本。我按照此页面的说明进行操作:https://realpython.com/blog/python/emacs-the-best-python-editor/ https://realpython.com/blog/python/emacs-the-best-python-editor/

当我尝试执行“%matplotlib inline”以便可以内联显示绘图时,出现以下错误:

“UnknownBackend:u'inline'没有事件循环集成。支持的事件循环有:qt、qt4、qt5、gtk、gtk2、gtk3、tk、wx、pyglet、glut、OSX”

我的emacs是24.4,jupyter笔记本版本是4.3

Thanks


如果您在 osx 上运行 matplotlib 这有助于解决我的问题:

  1. 我升级到 matplotlib-2.2.0目前已经有新版本2.2.0 https://apple.stackexchange.com/questions/301961/matplotlib-broken-after-pip-install-matplotlib-upgrade-to-version-2-1-0?rq=1
  2. 导入 matplotlib
  3. calling matplotlib.use('TkAgg')直接在导入 matplotlib 之后。(comments https://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python
  4. 导入 pyplot
  5. 调用 pyplot.plot()。
  6. call %matplotlib osx

我不得不打电话%matplotlib osx代替%matplotlib inline其中一条评论提到了这一点 https://github.com/ipython/ipython/issues/9834

之后就成功了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

UnknownBackend:在 emacs python 笔记本中启用内联 matplotlib 时,没有 u'inline' 的事件循环集成 的相关文章

随机推荐