Open xXWarMachineRoXx opened 10 months ago
I have the same issue.. I've tinkered around and this is one of the debugging logs:
Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-14.0-arm64-arm-64bit
Traceback (most recent call last): File "aqt.main", line 1237, in onAddCard File "aqt", line 136, in open File "aqt.addcards", line 51, in init File "aqt.addcards", line 78, in setupEditor File "aqt.editor", line 143, in init File "decorator", line 232, in fun File "anki.hooks", line 89, in decorator_wrapper File "anki.hooks", line 80, in repl File "aqt.editor", line 196, in setupWeb File "anki.hooks", line 45, in runFilter File "/Users/AnkiMan/Library/Application Support/Anki2/addons21/1746010116/init.py", line 34, in addMyButton keyStr = key.toString(QKeySequence.NativeText) AttributeError: type object 'QKeySequence' has no attribute 'NativeText'
keyStr = key.toString(QKeySequence.NativeText) AttributeError: type object 'QKeySequence' has no attribute 'NativeText'
keyStr = key.toString(QKeySequence.NativeText)
That seems to be the problem
PS: Also i noticed your using a mac, right?
Yes.
I'm not too computer savvy; how would I go about fixing this?
This only occurred after I updated Anki
There is a potential fix here: https://forums.ankiweb.net/t/pasteocr-adds-on-not-working/40098/3
Basically this particular error at line 34 of __init__.py
can be fixed by changing
QKeySequence.NativeText
to QKeySequence.SequenceFormat.NativeText
and
QKeySequence.PortableText
to QKeySequence.SequenceFormat.PortableText
@jack2game, seems like it.
I got the exact answer from chatgpt 4.
I'll try do a pull request and try and fix it
Yes.
I'm not too computer savvy; how would I go about fixing this?
This only occurred after I updated Anki
@thiotepamoa clone the repo and install on ur computer and make changes
After that push those changes to fix this
You would have to have moderate level pyhton experience and atleast beginner level anki / codebase knowledge
I ready made the PR
@jack2game #7 seems to address this issue will be merged when @mmaaz-git works on it
Issue Summary
Anki encounters an error related to the 'pasteOCR' add-on, preventing normal functionality. When attempting to start Anki, the application prompts an error message advising to start Anki while holding down the shift key. The stack trace indicates an attribute error involving 'QKeySequence.NativeText' in the 'pasteOCR' add-on.
Environment
Error Dump
Stack Trace
Steps to Replicate
Notes
__USER
with the actual user