hantian_pang
hantian_pang

Reputation: 1039

segmentation fault when using PyQtChart

I just installed PyQtChart 5.7. However I suffered from segmentation fault when creating QChart object. My code is really simple like this.

from PyQt5.QtChart import QChart

chart = QChart()

When I run it

[1]    27902 segmentation fault (core dumped)

Upvotes: 0

Views: 387

Answers (1)

September
September

Reputation: 436

You should have an QApplication object.

from PyQt5.QtChart import QChart
from PyQt5.Qt import QApplication
import sys

a = QApplication(sys.argv)
chart = QChart()

a.exec()

Upvotes: 1

Related Questions