kelciour / batch-download-pictures-from-google-images

7 stars 5 forks source link

[Anki 23.10 beta 6] No module named 'PyQt5' #24

Closed khonkhortisan closed 10 months ago

khonkhortisan commented 11 months ago

The Qt5 compatibility code is now off by default, which may break some add-ons that haven't been updated to support Qt6 in the last 2 years. If you find any have broken, please report the issues to the add-on author, and start Anki after setting the env var ENABLE_QT5_COMPAT to 1 to temporarily restore the compatibility code.

Error
Un complemento que has instalado ha fallado al cargarse. Si los problemas persisten, por favor ve a Herramientas> Menú de complementos o deshabilita este complemento.

Mientras cargando '⁨Batch Download Pictures From Google Images⁩':
⁨Traceback (most recent call last):
  File "aqt.addons", line 239, in loadAddons
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\561924305\__init__.py", line 29, in <module>
    from .designer.main import Ui_Dialog
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\561924305\designer\main.py", line 11, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ModuleNotFoundError: No module named 'PyQt5'

fix: main.py

#from PyQt5 import QtCore, QtGui, QtWidgets
try:
    from PyQt6 import QtCore, QtGui, QtWidgets
except ImportError:
    from PyQt5 import QtCore, QtGui, QtWidgets

replace every QtWidgets.QSizePolicy. with QtWidgets.QSizePolicy.Policy.
replace every setFrameShape(QtWidgets.QFrame.HLine) with setFrameShape(QtWidgets.QFrame.Shape.HLine)
replace every setFrameShadow(QtWidgets.QFrame.Sunken) with setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)

561924305\_init_\.py

replace every Qt.Align with Qt.AlignmentFlag.Align

    #if not d.exec_():
    if not d.exec():
        return
kelciour commented 10 months ago

Thank you!