Compatibillity problems between PyQt5 and qtpy

53 Views Asked by At

File: test_script.py

from PyQt5 import QtWidgets, QtCore, QtGui
pip install qtpy
pyinstaller --onedir test_script.py
cd dist/test_script
test_script.exe

Error:

Traceback (most recent call last):
  File "test_script.py", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
[7508] Failed to execute script 'test_script' due to unhandled exception!

The problem is related to qtpy because if i uninstall qtpy with: pip uninstall qtpy and then i run pyinstaller test_script.py then the exe run with no error.

How can I solve this?

Edit: the qtpy module is requirement of qtwidgets module (this is why i was needed). Edditing qtwidgets module (replace qtpy with PyQt5, Signal with pyqtSignal and Slot with pyqtSlot) and renaming qtwidgets module to extra_qtwidgets, solve the error in my occasion.

0

There are 0 best solutions below