import sys from PyQt5.QtGui import QPixmap from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QApplication,QWidget,QComboBox,QLabel,QPushButton,QSpinBox,QFrame, QHBoxLayout,QVBoxLayout,QGridLayout,QSpinBox,QColorDialog) class pixMapDemo(QWidget): def __init__(self): super(pixMapDemo, self).__init__() self.button = QLabel(self) self.button.setPixmap(QPixmap('python-logo.png')) self.resize(600,200) if __name__ == '__main__': app = QApplication(sys.argv) demo = pixMapDemo() demo.show() sys.exit(app.exec_()) 参考:PyQt5基本控件详解之QPixmap(十九)_jia666666的博客-CSDN博客_pyqt5 qpixmap