小编mra*_*ick的帖子

使用 MacOS 的 matplotlib 的哪个后端?

matplotlib与 MacOS 一起使用的问题是一个棘手的问题,已经通过许多讨论(见下文)进行了彻底审查。问题如下:

  • 使用 MacOS Mojave 10.14.3
  • 在 conda 环境中使用 python 3.7.2
  • 使用 matplotlib 3.0.3

这是我想出的最简单的代码片段,它允许重现问题:

from matplotlib import pyplot as plt

x = [1, 2, 3]
y = [1, 2, 3]

plt.plot(x, y)
plt.show()
Run Code Online (Sandbox Code Playgroud)

这会引发以下错误:

2019-03-22 12:25:43.429 python3.7[22209:554135] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f85866b9de0  
2019-03-22 12:25:43.431 python3.7[22209:554135] \*** Terminating app  due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f85866b9de0'  
*** First throw call stack:([...])
libc++abi.dylib: terminating with uncaught exception of type …
Run Code Online (Sandbox Code Playgroud)

python macos matplotlib

10
推荐指数
1
解决办法
5150
查看次数

标签 统计

macos ×1

matplotlib ×1

python ×1