0

I made a program using Qtdesigner:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'some.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(70, 210, 75, 23))
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_2.setGeometry(QtCore.QRect(180, 280, 75, 23))
        self.pushButton_2.setObjectName("pushButton_2")
        self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(150, 40, 160, 80))
        self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.checkBox = QtWidgets.QCheckBox(self.centralwidget)
        self.checkBox.setGeometry(QtCore.QRect(260, 250, 71, 18))
        self.checkBox.setObjectName("checkBox")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 20))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

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

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.pushButton.setText(_translate("MainWindow", "PushButton"))
        self.pushButton_2.setText(_translate("MainWindow", "PushButton"))
        self.checkBox.setText(_translate("MainWindow", "CheckBox"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())

and converted that into code using:

pyuic5 -x file.ui -o file.py.

Then I ran that and got:

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could
be initialized. Reinstalling the application may fix this problem.

I have PyQt5. I tried to reinstall it, to get 5.13.0 from 5.15.0, but it still doesn't work. I have pyqt5-tool v. 5.13.0.1.5.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Nikiphor
  • 31
  • 3
  • It seems that you application cannot find the PyQt libraries. Have you checked this answer (https://stackoverflow.com/questions/41994485/error-could-not-find-or-load-the-qt-platform-plugin-windows-while-using-matplo/42231526)[https://stackoverflow.com/questions/41994485/error-could-not-find-or-load-the-qt-platform-plugin-windows-while-using-matplo/42231526]? Does it give some good ideas? Hope this helps =) – William Spinelli Jun 06 '20 at 18:36
  • @WilliamSpinelli , Page not found. – Nikiphor Jun 07 '20 at 02:08
  • Try looking at this https://stackoverflow.com/q/41994485/2718008 Now the link should be OK – William Spinelli Jun 07 '20 at 06:24
  • Why is this a Sublime question? It is only the editor and unless you're asking a question specifically about Sublime it shouldn't be tagged. – the Tin Man Jun 08 '20 at 18:48
  • @theTinMan, Because I didn't want people would give me the same solutions for Anaconda which I've already seen. Sorry – Nikiphor Jun 11 '20 at 10:16
  • Tags don't do that, they help the search engines, and other members identify questions. The way to avoid being given recommendations you've already seen is to show where you researched the problem. Please see "[ask]", "[Stack Overflow question checklist](https://meta.stackoverflow.com/questions/260648)" and "[MCVE](https://stackoverflow.com/help/minimal-reproducible-example)" and all their linked pages, which describe everything we need to know. – the Tin Man Jun 11 '20 at 16:52

0 Answers0