Перейти к содержимому

Qt platform plugin windows ошибка как исправить

  • автор:

Что это за ошибка и как её исправить?

Сама ошибка:
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.

from myprogramm import * from PyQt5 import QtCore, QtGui, QtWidgets import sys class MyWin(QtWidgets.QMainWindow): def __init__(self, parent=None): QtWidgets.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) if __name__=='__main__': app = QtWidgets.QApplication(sys.argv) myapp = MyWin() myapp.show() sys.exit(app.exec_())
  • Вопрос задан более трёх лет назад
  • 276 просмотров

Комментировать
Решения вопроса 1

Open cmd and type echo %QT_PLUGIN_PATH% if it’s not empty then delete it (just google: delete environmental variable windows #, where # is your windows version)

Open cmd and type echo %PATH% and press enter. You’ll see a list separated by ; of folder paths. Go line by line and make sure they do not point to a folder that contains a platforms folder that has qwindows.dll in it. If you find such a path edit the PATH variable and remove it (just google: edit environmental variable windows #, where # is your windows version)

Ответ написан более трёх лет назад
Комментировать
Нравится 1 Комментировать
Ответы на вопрос 0
Ваш ответ на вопрос

Войдите, чтобы написать ответ

python

  • Python
  • +2 ещё

Python как получить данные из 1С находящейся на удаленном рабочем столе?

  • 1 подписчик
  • 5 минут назад
  • 2 просмотра

How to resolve «no Qt Platform Plugin could be initialized» for a Qt5 application?

This is the Error Dialog

I am working on a python application based on PyQt5. Everything was running good until I redo my PC and reinstall windows again because of some issue. I had copied my environment and after reinstalling Anaconda, I copied that environment again in env folder. Now the problem is that, when I run my code in PyCharm IDE, it displays and error dialog like this: I have tried multiple solutions such as: Solution 1: Change the QT Files Location Sometimes, a simple trick such as changing the QT files location is enough to get rid of the error. Here’s how you can do it:

  1. Launch File Explorer and open This PC.
  2. Using the Search field, search for pyqt5_tools.
  3. When Windows finishes the search, right-click the pyqt5_tools and head to Open folder location.
  4. Head to PyQt5 > Qt > bin. Copy the platforms folder. in my case bin is not available in this folder
  5. Make a new search for site-packages and open the folder.
  6. There, paste the platforms folder.
  7. Windows will warn you there’s already a folder with the same name. Click Replace the files in the destination.

Solution 2: Run an SFC Scan

There’s a chance Windows display the “Application failed because no QT platform plugin could be initialized” error due to corrupt system files. Fortunately, Windows has a built-in tool to help you fix the problem.

In the Start menu search bar, search for command prompt and select Run as administrator. Then, run the sfc /scannow command line. Windows will scan and automatically replace any corrupted system file.

Nothing worked for me, I’m getting the same error all the time. How can I resolve the error displayed in the figure above?

Any help will be appreciated, Thanks.

Ошибка при запуске примеров, использующих PyQT5

Здравствуйте. У меня при запуске простейших примеров на Python (в PyCharm) возникает ошибка: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Хотя и PyQT5 и PyQT5-tools (с дизайнером) установлены. Переустанавливать пробовал, не помогает.
При запуске из командной строки: 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.

Qt.qpa.plugin: Could not find the Qt platform plugin «windows» in «»?

У меня появилась ошибка когда запускаю python файл, пж помогите не нужно кидать ссылку на форум просто скажите что сделать?

C:\Users\Андрей>»C:\Users\Андрей\Desktop\Currency Convertor\ui.py»
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.

  • Вопрос задан более двух лет назад
  • 15920 просмотров

Комментировать
Решения вопроса 1

Scripteer

Андрей Андреев @Scripteer Автор вопроса
Веб дизайнер, интересуюсь python, знаю html,css +-

РЕШЕНИЕ: Найти папку где установлен python, перейти по пути C:\Users\Андрей\AppData\Local\Programs\Python\Python38\Lib\site-packages\PyQt5\Qt\plugins найти тут папку platforms и перенести в папку где находится python

Ответ написан более двух лет назад
Нравится 10 2 комментария

Scripteer

Андрей Андреев @Scripteer Автор вопроса

Никогда не думал что вернусь с этой проблемой но я переустанавливал python, и мне опять пришлось переносить platforms, но опять же помогло, так что проверено 2 раза. Спасибо

Scorpion_MB

Михаил Болеев @Scorpion_MB

Андрей Андреев, Не сразу понял где искать platforms (искал в папке с установленной программой, но не получилось). Когда нашел, то сделал как написано, и все получилось. Спасибо!

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *