我有简单的代码块可以生成绘图。
import matplotlib
from matplotlib import pyplot as plt
import faulthandler
faulthandler.enable()
fig = plt.figure()
x = range(10)
y = range(10)
plt.subplot(2, 2, 1)
plt.plot(x, y)
plt.subplot(2, 2, 2)
plt.plot(x, y)
plt.subplot(2, 2, 3)
plt.plot(x, y)
plt.subplot(2, 2, 4)
plt.plot(x, y)
plt.show()
我用pyinstaller编译了它以创建二进制文件。我在图创建plt.figure()中遇到分段错误。
Fatal Python error: Segmentation fault
Current thread 0x00007ff4e0e24700 <test> (most recent call first):
File "site-packages/matplotlib/transforms.py", line 1988 in scale
File "site-packages/matplotlib/figure.py", line 327 in __init__
File "site-packages/matplotlib/backends/backend_qt5agg.py", line 43 in new_figure_manager
File "site-packages/matplotlib/pyplot.py", line 535 in figure
File "test.py", line 6 in <module>
Segmentation fault
什么可能导致此故障?我该如何解决?
python 2.7.12 pyinstaller 3.3.1 matplotlib 2.0.2
谢谢