问题描述
所以我正在尝试让seaborn运行一些东西(特别是示例)
So I'm trying to get some stuff running with seaborn (specifically this example)
但是,当我在普通的ipython
上运行时,出现标题中列出的运行时错误.这似乎是一个后端问题,但是我在其他任何绘图工具中都没有遇到过.甚至更陌生,如果我在ipython notebook
中运行,我将不再遇到该错误.我现在当然可以在笔记本电脑上工作,并且可以避免出现问题,但这与在终端中发生有关.
However when I run on normal ipython
I get the runtime error listed in the title. It seems like a backend issue but I don't experience this with any other plotting utilities. Even stranger, if I run in the ipython notebook
I no longer experience that error. I can certainly work with in the notebook for now and avoid problems but it's concerning that this happens in a terminal.
推荐答案
这似乎与MacOSX
后端有关.已在matplotlib
的问题跟踪器中对其进行了跟踪,但是显然,该修复需要大量重写,并且尚未完成. (我猜想与此问题有关.)
This seems to be an issue with the MacOSX
backend. It is tracked at matplotlib
's issue tracker, but a fix apparently needs major rewriting and is not finished yet. (I guess related to this issue).
同时切换绘图后端是一种解决方法.
In the meantime switching the plotting backend is a workaround.
例如,这可以完成通过命令行通过以下方式启动ipython
This can be done e.g. via command line by starting ipython with
ipython --matplotlib <your-favorite-backend>
选择一个无效的后端(ipython --matplotlib ??
)将打印所有可用的后端.
Choosing an invalid backend (ipython --matplotlib ??
) will print all available backends.
[TerminalIPythonApp] CRITICAL | Bad config encountered during initialization:
[TerminalIPythonApp] CRITICAL | The 'matplotlib' trait of a TerminalIPythonApp instance must be any of ['auto', 'gtk', 'gtk3', 'inline', 'nbagg', 'osx', 'qt', 'qt4', 'qt5', 'tk', 'wx'] or None, but a value of '??' <class 'str'> was specified.
这篇关于RuntimeError:无法使用Seaborn获取不带渲染器的窗口范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!