Crash on startup after update to 26.09.2

Ironically, updating from 26.09 to 26.09.2 has caused what the update claimed to fix: A crash on startup

It only shows this backtrace:

Traceback (most recent call last):
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app\anki\__main__.py", line 21, in <module>
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app\anki\app.py", line 6, in main
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\aqt\__init__.py", line 18, in <module>
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\truststore\_api.py", line 53, in inject_into_ssl
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\requests\__init__.py", line 47, in <module>
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\requests\exceptions.py", line 14, in <module>
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\requests\compat.py", line 49, in <module>
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\requests\compat.py", line 43, in _resolve_char_detection
  File "importlib\__init__.py", line 88, in import_module
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\charset_normalizer\__init__.py", line 26, in <module>
  File "D:\a\anki\anki\out\installer\build\anki\windows\visualstudio\x64\Release\app_packages\charset_normalizer\api.py", line 7, in <module>
  File "src/charset_normalizer/cd.pyx", line 1, in init charset_normalizer.cd
AttributeError: module 'charset_normalizer.md' has no attribute 'CharInfo'

Not sure why it shows that D:\a path, that’s not where Anki is installed. It’s a system-wide installation in C:\Program Files as usual.

I also noticed that Anki seems to have trouble with properly updating an existing installation, which is likely related:

I’ll try uninstalling all of them, and clean re-installing latest Anki.

Yes, after 5 individual uninstalls, the Anki dir was gone from Program Files, and after a reinstall, it works fine again.

But one of my AddOns, which worked fine on 26.9.0 before now fails to load on 26.9.2, which seems odd. I guess there were files left over and somehow still worked.

I assume you’re @BtbN on GitHub: All-users installation of MSI package fails to detect existing installation · Issue #5037 · ankitects/anki · GitHub

Can you run the .msi from the terminal with logging enabled using a command like this and send the log file?

msiexec /i "anki-26.09.2-win-x64.msi" /L*V "install.log"

I had a similar startup crash while testing the update from 26.09 to 26.09.1 (which is why 26.09.1 was skipped). The issue turned out to be that Windows installer is skipping copying/updating some files because they have older versions. 26.09.2 is supposed to force-copy all files regardless of their versions, but only for non-administrative installations according to Windows Installer’s behavior. I’ll see if there’s a way to enforce that consistently. (EDIT: this is wrong - administrative Installation is about network installation).

Can you post the error? It’s probably related to fix: Lock bundled dependencies by abdnh · Pull Request #5593 · ankitects/anki · GitHub

I’m on LMDE 7, and after updating from 26.09 I am getting the following error when I try to run anki:

Application quit abnormally!
Traceback (most recent call last):
  File "<frozen runpy>", line 203, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app/anki/__main__.py", line 21, in <module>
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app/anki/app.py", line 6, in main
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/aqt/__init__.py", line 18, in <module>
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/truststore/_api.py", line 53, in inject_into_ssl
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/requests/__init__.py", line 47, in <module>
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/requests/exceptions.py", line 14, in <module>
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/requests/compat.py", line 49, in <module>
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/requests/compat.py", line 43, in _resolve_char_detection
  File "/usr/local/share/anki/python/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/charset_normalizer/__init__.py", line 26, in <module>
  File "/home/runner/work/anki/anki/out/installer/build/anki/linux/zip/anki/app_packages/charset_normalizer/api.py", line 7, in <module>
  File "src/charset_normalizer/cd.pyx", line 1, in init charset_normalizer.cd
AttributeError: module 'charset_normalizer.md' has no attribute 'CharInfo'

(Seems similar to here.)

Yes, it does. So it will probably have the same solution and we should keep it in the same thread.

Did you try what (eventually) worked for OP? Crash on startup after update to 26.09.2 - #2 by Oromit

And answering the dev’s question will help too – Crash on startup after update to 26.09.2 - #3 by abdo .

The AddOn error is quite simple:

ModuleNotFoundError: No module named 'anki.importing.apkg'; 'anki.importing' is not a package

So it only worked on 26.09 because I had 5 different versions installed on top of each other, so the module was simply still there and working.

Attached three msi logs on the GitHub issue.

apologies, wasn’t sure if I should add to this thread or not. Thanks for responding!

I’d tried un- and reinstalling ~5 times but didn’t work. Ended up just deleting all files and reinstalling – that seems to have done it.

A possible fix (worked for me): forums.ankiweb.net/t/71074 (can’t post a link since I’m a new user).

I had the same error message as above, with mention of a D:, which is my external hard drive. After I unplugged that and reran the installation, it worked.

Are you building the installer yourself or using the installer that is downloaded from the releases page?

If you could give me some exact steps to re-produce this it would be very helpful.