UnknownBackend: No event loop integration for u'inline' when enable inline matplotlib in emacs python notebook

与世无争的帅哥 提交于 2020-01-24 21:53:04

问题


I am trying to enable the python notebook in emacs. I am following the instruction from this page: https://realpython.com/blog/python/emacs-the-best-python-editor/

When I tried to do "%matplotlib inline" so that I can show the plot inline, I got the following errors:

"UnknownBackend: No event loop integration for u'inline'. Supported event loops are: qt, qt4, qt5, gtk, gtk2, gtk3, tk, wx, pyglet, glut, OSX"

My emacs is 24.4 and jupyter notebook version is 4.3

Thanks


回答1:


If you are running matplotlib on osx this helped resolve my problem:

  1. I upgraded to matplotlib-2.2.0 by now there is a new version 2.2.0
  2. Import matplotlib
  3. calling matplotlib.use('TkAgg') directly after the import of matplotlib.(comments
  4. importing pyplot
  5. call pyplot.plot().
  6. call %matplotlib osx

I had to call %matplotlib osx instead of %matplotlib inlineone of the comment mentiond it

After that it worked.



来源:https://stackoverflow.com/questions/49347477/unknownbackend-no-event-loop-integration-for-uinline-when-enable-inline-matpl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!