I tried to used Japanese Support and I get this error I already add mecab.exe to the exception in the antivirus but still the same problem I install and re installed the addon and same problem Im not sure what to do next can you please give me a hand ?
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you’ve discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-09-09 13:04:39
Caught exception:
Traceback (most recent call last):
File “aqt\webview.py”, line 37, in cmd
File “aqt\webview.py”, line 123, in _onCmd
File “aqt\webview.py”, line 547, in _onBridgeCmd
File “aqt\editor.py”, line 401, in onBridgeCmd
File “aqt\gui_hooks.py”, line 1487, in call
File “anki\hooks.py”, line 594, in runFilter
File “C:\Users\Rin\AppData\Roaming\Anki2\addons21\3918629684\reading.py”, line 223, in onFocusLost
n[dst] = mecab.reading(srcTxt)
File “C:\Users\Rin\AppData\Roaming\Anki2\addons21\3918629684\reading.py”, line 86, in reading
self.mecab.stdin.flush()
OSError: [Errno 22] Invalid argument
some reading for numbers doesn’t seems to fail to use the correct form automatically (hyaku/byaku/pyaku/sen/zen …)
it seems to not translate the number some time, for example : 三百 turn into 三 百[ひゃく]
but when mistake I found is 出口 that turn into 出口[いでぐち] instead of 出口[でぐち]
and 入り口 turn into 入り口[いりくち] instead of 入り口[いりぐち]
Haven’t used this, but the add-on page states that:
The reading generation is a timesaving device. Most of the time it will get the reading right, but it is not perfect. After the reading has been generated, you’ll need to read the generated text and make any necessary corrections.
There’s way too many exceptions especially with counters and rendaku for it to get everything correctly. I suppose it’s not using a dictionary, but just generating a possible reading. Although that disappearing character three sounds weird.
Is there anyway to add furigana for only specific words without this add-on? I only use furigana in like 5 cards out of a 1000, but it would be nice to have them in those cases, and working on mobile as well.
The furigana card template filter is supported on all platforms, but the text is expected to be in a particular format, so I recommend using the add-on to generate the reading rather than entering it in manually.
I got stuck on this Invalid Argument OSError for a bit too, and it seems like I have a problem with mecab.exe itself crashing. I am using Windows 10. If I run it several times from command prompt, it will sometimes start successfully (where it waits for inputs), but sometimes it crashes at startup. I noticed I could track these crashes in the Event Viewer in Windows and they appear to be some kind of memory error. Given that it does work sometimes, I tried adding some simple retry logic to MecabController in reading.py as a workaround.
def parseWithMecab(self, expr):
"""mecab.exe on Windows 10 will occasionally crash. Try up to 10 times."""
for attempt in range(10):
try:
self.ensureOpen()
self.mecab.stdin.write(expr.encode("utf-8", "ignore") + b'\n')
self.mecab.stdin.flush()
return self.mecab.stdout.readline().rstrip(b'\r\n').decode('utf-8', "replace")
except OSError:
self.mecab = None
raise Exception("Could not communicate with {} - check your antivirus".format(self.mecabCmd))
And modified the beginning of reading accordingly.
Thanks daofma. I don’t recall other reports of intermittent errors - are you using an antivirus program or some other program that runs in the background? If it’s affecting multiple users then a retry loop might work as a workaround, but I’m not sure that makes sense if it’s a single system, and ideally we’d understand the error rather than plastering over it.
I certainly agree the best solution would be to have the program not crash at all. I only have Windows’ built-in Defender running and couldn’t find any reports of it having taken action, but I did find the crash reports. (I’m not sure if defender could do something to cause memory errors.) humza reported intermittent issues in this thread above. I think retrying/restarting a subprocess is a good practice - if the subprocess gets killed for some reason (however unlikely it may normally be), it’s good to keep the main application working. I guessed it could be due to ASLR (it seems like that is new in Windows 10), but after disabling it the crashes still happen. At least without ASLR the fault seems to occur at the same address each time, so it looks like something realistic to debug, but I am satisfied with the workaround and I don’t know how to do so on Windows, so I’m not planning to look into this further. I would be happy to share any more info or try other debugging steps if it’s helpful, though.
Hello, I have uploaded Japanese support onto Anki but I can’t seem to make it work. I have restarted Anki and have uploaded the add-on correctly, but the Japanese card type is not showing up.
Debug info:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-06-09 21:52:12
Caught exception:
Traceback (most recent call last):
File “aqt\webview.py”, line 36, in cmd
File “aqt\webview.py”, line 135, in _onCmd
File “aqt\webview.py”, line 580, in _onBridgeCmd
File “aqt\editor.py”, line 451, in onBridgeCmd
File “aqt\hooks_gen.py”, line 1547, in call
File “anki\hooks.py”, line 45, in runFilter
File “C:\Users\rdfra\AppData\Roaming\Anki2\addons21\3918629684\reading.py”, line 206, in onFocusLost
dst = dstFields[srcIdx]
IndexError: list index out of range
For me it works when adding a new card, but not when editing a card in the browser. Instead I get the message ignored late blur in the terminal, and nothing else.
I did some further investigating, and it turns out that at least in my case it was another addon causing the issue. I’ll edit this post when I figure out which one, for anyone else who runs into this problem.
I’m struggling to get the Kanji statistics functionality to work over my custom deck, and would welcome some help.
Just for context: my deck is one of many within my profile and contains 3 note types, each of which with 2 cards (for meaning and reading). Specifically, I have a note model “kanji Model” with “Kanji” as the primary field (it only ever contains a single Kanji). I’d like cards from these notes to be tracked, without much care for only one or both being required.
Since I didn’t know what entailed the concept of a kanji being “seen”, I’ve manually matured both the meaning and reading cards for 一 (いち), which are counted at regular statistics as the only 2 matured cards in the deck (it’s mostly new). They do not show at Kanji statistics, though, which remains at a 0 count.