鱼C论坛

 找回密码
 立即注册
查看: 1618|回复: 2

[已解决]ModuleNotFoundError: No module named 'image_rc'

[复制链接]
发表于 2021-8-5 15:33:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 1062195630 于 2021-8-5 16:08 编辑


###主程序
import sys
import sign_in_window
from PyQt5.QtWidgets import QApplication,QMainWindow

if __name__ == '__main__':
    app=QApplication(sys.argv)
    mainwindow=QMainWindow()
    ui=sign_in_window.Ui_sign_in_window()
    ui.setupUi(mainwindow)
    mainwindow.show()
    sys.exit(app.exec_())

!!!!!!!!!!!!为啥会报错啊ModuleNotFoundError: No module named 'image_rc'

######sign_in_window程序
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'sign_in_window.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_sign_in_window(object):
    def setupUi(self, sign_in_window):
        sign_in_window.setObjectName("sign_in_window")
        sign_in_window.resize(624, 265)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(sign_in_window)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.graphicsView_2 = QtWidgets.QGraphicsView(sign_in_window)
        self.graphicsView_2.setStyleSheet("border-image: url(:/photo/fasheaixin.gif);")
        self.graphicsView_2.setObjectName("graphicsView_2")
        self.horizontalLayout_2.addWidget(self.graphicsView_2)
        self.line = QtWidgets.QFrame(sign_in_window)
        self.line.setFrameShape(QtWidgets.QFrame.VLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.horizontalLayout_2.addWidget(self.line)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.label_3 = QtWidgets.QLabel(sign_in_window)
        self.label_3.setObjectName("label_3")
        self.verticalLayout_3.addWidget(self.label_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, -1, 0, 10)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label = QtWidgets.QLabel(sign_in_window)
        self.label.setObjectName("label")
        self.verticalLayout_2.addWidget(self.label)
        self.label_2 = QtWidgets.QLabel(sign_in_window)
        self.label_2.setObjectName("label_2")
        self.verticalLayout_2.addWidget(self.label_2)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.account = QtWidgets.QLineEdit(sign_in_window)
        self.account.setObjectName("account")
        self.verticalLayout.addWidget(self.account)
        self.secret = QtWidgets.QLineEdit(sign_in_window)
        self.secret.setObjectName("secret")
        self.verticalLayout.addWidget(self.secret)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.horizontalLayout.setStretch(0, 1)
        self.horizontalLayout.setStretch(1, 3)
        self.verticalLayout_3.addLayout(self.horizontalLayout)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setContentsMargins(-1, 12, 0, 0)
        self.horizontalLayout_3.setSpacing(11)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem1)
        self.sign_in_button = QtWidgets.QPushButton(sign_in_window)
        self.sign_in_button.setObjectName("sign_in_button")
        self.horizontalLayout_3.addWidget(self.sign_in_button)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.verticalLayout_3.addLayout(self.horizontalLayout_3)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem3)
        self.verticalLayout_3.setStretch(1, 2)
        self.verticalLayout_3.setStretch(2, 1)
        self.verticalLayout_3.setStretch(3, 1)
        self.verticalLayout_3.setStretch(4, 2)
        self.horizontalLayout_2.addLayout(self.verticalLayout_3)

        self.retranslateUi(sign_in_window)
        QtCore.QMetaObject.connectSlotsByName(sign_in_window)

    def retranslateUi(self, sign_in_window):
        _translate = QtCore.QCoreApplication.translate
        sign_in_window.setWindowTitle(_translate("sign_in_window", "mylover"))
        self.label_3.setText(_translate("sign_in_window", "亲爱滴臭宝!请输入账号密码呦....."))
        self.label.setText(_translate("sign_in_window", "账号"))
        self.label_2.setText(_translate("sign_in_window", "密码"))
        self.sign_in_button.setText(_translate("sign_in_window", "登录"))
import image_rc
最佳答案
2021-8-5 20:42:09
为啥你的 import image_rc 写在这么下面
image_rc 是你自己写的文件吗,是的话会不会是不在同一文件夹下
或者参考https://blog.csdn.net/qq_4245530 ... 1018.2226.3001.4187
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-8-5 20:42:09 | 显示全部楼层    本楼为最佳答案   
为啥你的 import image_rc 写在这么下面
image_rc 是你自己写的文件吗,是的话会不会是不在同一文件夹下
或者参考https://blog.csdn.net/qq_4245530 ... 1018.2226.3001.4187
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-1-13 17:40

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表