1
from PyQt5 import QtCore, QtGui, QtWidgets,QtPrintSupport
from PyQt5 import QPrinter

import sqlite3

运行此错误时显示: ImportError: cannot import name 'QPrinter' from 'PyQt5' 任何帮助请

4

1 回答 1

3

QPrinter是里面的一个类QtPrintSupport,而不是像这样导入:

from PyQt5.QtPrintSupport import QPrinter
于 2019-05-09T21:20:13.990 回答