anki-redesign icon indicating copy to clipboard operation
anki-redesign copied to clipboard

Add-on Startup Failed

Open aadesouz opened this issue 2 years ago • 9 comments

Anki 23.10 (51a10f09) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-14.0-x86_64-i386-64bit Flags: frz=True ao=True sv=3 Add-ons, last update check: 2023-11-06 06:16:37

When loading Anki-redesign: Traceback (most recent call last): File "aqt.addons", line 244, in loadAddons File "/Users/aarondesouza/Library/Application Support/Anki2/addons21/308574457/init.py", line 11, in from PyQt5.QtWidgets import QWidget ModuleNotFoundError: No module named 'PyQt5'

aadesouz avatar Nov 06 '23 12:11 aadesouz

The following add-ons failed to load: ⁨ Anki-redesign⁩ They may need to be updated to support this version of Anki. Click the Check for Updates button to see if any updates are available. You can use the Copy Debug Info button to get information that you can paste in a report to the add-on author. For add-ons that don't have an update available, you can disable or delete the add-on to prevent this message from appearing.

aadesouz avatar Nov 06 '23 12:11 aadesouz

@flippantbird Change that line to from aqt.qt import QWidget

@Shirajuki They've moved all Qt modules to aqt now.

kvn1351 avatar Nov 22 '23 18:11 kvn1351

Perfect, thanks!!

aadesouz avatar Nov 22 '23 18:11 aadesouz

@flippantbird The issue still exists in the codebase so keep it open pls

kvn1351 avatar Nov 22 '23 18:11 kvn1351

I've also fixed the config window but that isn't a one line change. I'll make a PR if time allows.

kvn1351 avatar Nov 22 '23 23:11 kvn1351

I had luck resolving this by replacing "PyQt5" with "PyQt6" in __init__.py, and then using the script found here (https://stackoverflow.com/a/72658216/3261260) to replace all of the Qt5 enums with the Qt6 versions. No crashes on startup or when opening the configuration menu.

AustinHasten avatar Nov 30 '23 17:11 AustinHasten

This issue is still present in Anki version 23.10.1

ArcticDev78 avatar Dec 21 '23 16:12 ArcticDev78

I had luck resolving this by replacing "PyQt5" with "PyQt6" in init.py, and then using the script found here (https://stackoverflow.com/a/72658216/3261260) to replace all of the Qt5 enums with the Qt6 versions. No crashes on startup or when opening the configuration menu.

Hi! How are you? I'm here because I'm having this issue as well, and I'm not much of a developer so I don't know how to fix it, sadly. Someone from Anki's Discord server told me I should ask you, so here it goes: could you please upload the code of your updated init.py file to Pastebin? Thanks!

chatterine avatar Jan 13 '24 20:01 chatterine