Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing Error: qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found. #3

Closed
24Naman opened this issue Jan 29, 2021 · 3 comments

Comments

@24Naman
Copy link

24Naman commented Jan 29, 2021

Hi,
I'm trying to use pyedifice but on running the code, faced with error

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

Available platform plugins are: direct2d, minimal, offscreen, windows.

The program used is calculator.py which is provided in the examples directory.

Solutions Tried:

1. Installed pyqt5 (pip install pyqt5)
2. Installed PyQt5-tools (pip install PyQt5-tools)
3. Reinstalled pyedifice

Systems detials:

  • OS: Windows 10 (Build: 19042.746)
  • Python Version: 3.8.5

Regards

@fding
Copy link
Member

fding commented Feb 2, 2021

Hi,

Do you have Pyside2 installed? Otherwise, to use pyqt5, you have to set the EDIFICE_QT_VERSION environment variable to PyQt5, since the default library used is PySide2. You can do this via:

EDIFICE_QT_VERSION=PyQt5 python -m edifice calculator.py

or

export EDIFICE_QT_VERSION=PyQt5  # You can put this in your bashrc or your shell init script
python -m edifice calculator.py

Another potential issue with Windows 10 (especially if you want to use the Linux subsystem) is setting up an XServer. Are you able to get raw QT working?

from PyQt5 import QtWidgets
app = QtWidgets.QApplication([])
window = QtWidgets.QLabel("Hello World")
window.show()
app.exec_()

If not, you might have to install an XServer, e.g. https://sourceforge.net/projects/xming/

Let me know if these solutions work or not!

@24Naman
Copy link
Author

24Naman commented Feb 2, 2021

Hi,
Setting EDIFICE_QT_VERSION=PyQt5 worked for me.
Thank you very much

@24Naman 24Naman closed this as completed Feb 2, 2021
@microwavestine
Copy link

microwavestine commented Mar 7, 2021

For Macbook users who have 2 QT libraries crashing together, throwing errors like
"... Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.",

Run these on bash:
export DYLD_PRINT_LIBRARIES=1
export EDIFICE_QT_VERSION=PyQt5

And remember to put the class name to run at the end
python -m tutorial.py Oscillator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants