0

I have written an application that accesses the api of a service and retrieves data from it, displaying it in a GUI written using the PyQt5 library. I need to install this application on all computers in our office.

The application works fine on my Fedora Linux platform. It runs on my second PC with Windows 10 and Windows 11. But on some PCs (windows 10) I get an error when running the python app.py program:

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 reinstalled PyQt5 with the command -

pip install pyqt5

This had no effect and I was getting the same message.

I also copied the qwindows.dll file from the platforms directory to the root as advised by ChatGpt. This had no affect as well.

Thanks for the help.

Nob0Dy
  • 54
  • 6
  • Why don't you use something like [pyinstaller](https://pyinstaller.org/en/stable/#quickstart) to create an executable file? This way, all dependencies should be distributed alongside your application folder and hopefully you should avoid the error. By creating an .exe, there's no need to reinstall dev tools (or python) on each client. Note that, in order to create an executable, you must create it on your target machine. To create a windows app, use pyinstaller on windows. – Carl HR Aug 30 '23 at 12:16
  • on some PCs (where I can't install dependencyes with PyQt5) I get an error too. – Verney Flores Aug 30 '23 at 14:10
  • ```(venv) PS C:\Users\Апостол\Desktop\sms900_w> pyinstaller .\sms900.py 1643 INFO: PyInstaller: 5.13.0 1644 INFO: Python: 3.11.5 1667 INFO: Platform: Windows-10-10.0.19045-SP0 ......... File "C:\Users\Апостол\Desktop\sms900_w\venv\Lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 841, in add_qt_dependencies return qt_info.collect_module(module_name) ^^^^^^^^^^^^^^^^^^^^ Exception: Qt plugin directory 'C:/Users/Àïîñòîë/Desktop/sms900_w/venv/Lib/site-packages/PyQt5/Qt5/plugins' does not exist! (venv) PS C:\Users\Апостол\Desktop\sms900_w> – Verney Flores Aug 30 '23 at 14:13
  • 1
    Does this answer your question? [PySide2 application failed to start](https://stackoverflow.com/questions/51367446/pyside2-application-failed-to-start) – relent95 Sep 01 '23 at 06:29
  • 1
    The cause and solution are the same as the ones in the answer to the above question, although it's for PySide2 not PyQt5. – relent95 Sep 01 '23 at 06:31
  • @Verney Flores Do not use the comment section to update your question, [edit] and add additional information, details and/or code to your original post unless it is in fact a short comment. You can see code posted in comments has little to none formatting and is generally unreadable. – moken Sep 01 '23 at 10:46

0 Answers0