iamjustkoi / StudyTimeStats

Customizable statistics add-on for Anki.
https://ankiweb.net/shared/info/1247171202
MIT License
21 stars 4 forks source link

Study Time Stats fails to load - "No module named 'PyQt5'" #39

Closed cdrch closed 11 months ago

cdrch commented 1 year ago

Bug/Issue Description Study Time Stats fails to load, with a mention of "No module named 'PyQt5'" in the debug screen.

To Reproduce Steps to reproduce:

  1. Install Study Time Stats v2.0.6.
  2. Restart Anki.
  3. Error appears and Study Time Stats fails to load.

System/Debug Info Anki 23.10.1 (fac9e0ee) Python 3.9.15 Qt 6.6.0 PyQt 6.6.0 Platform: Windows-10-10.0.19045 Flags: frz=True ao=True sv=3 Add-ons, last update check: 2023-11-10 19:13:44

When loading Study Time Stats: Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "C:\Users\Carter David\AppData\Roaming\Anki2\addons21\1247171202__init__.py", line 8, in from .src import toolbar File "C:\Users\Carter David\AppData\Roaming\Anki2\addons21\1247171202\src\toolbar.py", line 12, in from .options import TimeStatsOptionsDialog File "C:\Users\Carter David\AppData\Roaming\Anki2\addons21\1247171202\src\options.py", line 41, in from ..res.ui.cell_item import Ui_CellWidget File "C:\Users\Carter David\AppData\Roaming\Anki2\addons21\1247171202\res\ui\cell_item.py", line 11, in from PyQt5 import QtCore, QtGui, QtWidgets ModuleNotFoundError: No module named 'PyQt5'

Additional Context May be related to #37 but I do not see a mention of this particular error there. Note that no other version of Anki or other Qt applications are installed (to my knowledge) - this may have been missed due to other users having a version of PyQt5 present on their machine.

AnKingMed commented 1 year ago

had the same issue. @iamjustkoi do you need help updating it?

iamjustkoi commented 1 year ago

Hey, sorry to hear, and thanks for reporting!

had the same issue. @iamjustkoi do you need help updating it?

I really appreciate the offer! Honestly, I've been having to deal with so many recent life things that've popped up that I haven't really been able to code as much as I would've liked to for this or some other projects.

If a PR was submitted for this it'd really help a lot and I could push an update out really quick after taking a look!

Either way I'll try to see what I can do when I can, too, if nothing else!

cdrch commented 1 year ago

I don't currently have time for helping much, but wanted to point this out for anyone else looking into doing a PR and to make sure @iamjustkoi saw this before doing future updates:

# Form implementation generated from reading ui file 'cell_item.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.

I don't know for sure if just regenerating the Python using the PyQt6 version of the UI code generator would fix everything, but at the least it's necessary here, and that'll need to happen for any future updates. (I'm not sure if this means that there would need to be separate version for Qt5 and Qt6 since there are still two Anki versions...which could also be the source of this bug being missed, if iamjustkoi is using the Qt5 version for testing.)

iamjustkoi commented 11 months ago

Going to move this over to #40 to consolidate the threads!

Since someone posted a nice hot fix to work off of, I've been able to start on fixing the it up for 23.10+ versions and making some headway on a generalized patch! Thanks again for all the info and kind/helpful words! :D