Technical issue with Anki Desktop

Hello,
I have been trying to fix this issue for the past day, sadly to no real awail. I have tried deinstalling, reinstalling, deleting add-ons, but the issues still persist. Could someone with knowledge of the problem help me out eventualy? I would be very greatful.

Anki 2.1.57 (6b7d372c) Python 3.9.15 Qt 6.4.2 PyQt 6.4.0
Platform: Windows-10-10.0.19044
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2023-02-02 13:19:01

Caught exception:
Traceback (most recent call last):
File “aqt.webview”, line 43, in cmd
File “aqt.webview”, line 150, in _onCmd
File “aqt.webview”, line 620, in _onBridgeCmd
File “aqt.overview”, line 92, in _linkHandler
File “aqt.main”, line 710, in moveToState
File “aqt.main”, line 731, in _reviewState
File “aqt.reviewer”, line 153, in show
File “aqt.reviewer”, line 481, in _shortcutKeys
AttributeError: ‘AnkiQt’ object has no attribute ‘flags’

P.S. When I try to open Anki this message pops up

Anki 2.1.57 (6b7d372c) Python 3.9.15 Qt 6.4.2 PyQt 6.4.0
Platform: Windows-10-10.0.19044
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2023-02-02 13:19:01

Caught exception:
Traceback (most recent call last):
File “aqt.progress”, line 118, in handler
File “aqt.main”, line 219, in on_window_init
File “aqt.main”, line 264, in setupProfileAfterWebviewsLoaded
File “aqt.main”, line 315, in setupProfile
File “aqt.main”, line 475, in loadProfile
File “aqt.main”, line 559, in setup_sound
File “aqt.sound”, line 867, in setup_audio
File “aqt.tts”, line 269, in
File “C:\Program Files\Anki\lib\win32com_init_.py”, line 5, in
import win32api, sys, os
ImportError: Module use of python38.dll conflicts with this version of Python.

1 Like

We’ve had a number of these reports, but you’re the first one to include the startup message - thank you!

Does removing the c:\program files\anki folder manually, then installing Anki 2.1.57 again fix the problem?

1 Like

Any luck? From some Googling, another possible explanation is that some other app you’ve installed on your system has set the PYTHONPATH envirnomental variable. If removing the Anki folder and reinstalling did not help, please go to Start>Run, run cmd.exe, and type the following in and press enter:

echo %PYTHONPATH%
echo %PATH%

What does it print?

I’ve been having the same problem. i tried manually deteting the whole Anki folder in program files but unfortunately it is still showing this message

Error
An error occurred. Please use Tools > Check Database to see if that fixes the problem.
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.57 (6b7d372c) Python 3.9.15 Qt 6.4.2 PyQt 6.4.0
Platform: Windows-10-10.0.19044
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2023-02-02 09:41:23

Caught exception:
Traceback (most recent call last):
File “aqt.webview”, line 43, in cmd
File “aqt.webview”, line 150, in _onCmd
File “aqt.webview”, line 620, in _onBridgeCmd
File “aqt.overview”, line 92, in _linkHandler
File “aqt.main”, line 710, in moveToState
File “aqt.main”, line 731, in _reviewState
File “aqt.reviewer”, line 153, in show
File “aqt.reviewer”, line 481, in _shortcutKeys
AttributeError: ‘AnkiQt’ object has no attribute ‘flags’

i tried entering the code in Run and this is what was printed
C:\Users\elsie>echo %PATH%

im not sure what this means! so if anybody has an idea of what it means/what i can do to get access to my cards i would be very grateful

This is the sort of thing you should see:

2023-02-06T16:06:29,585794740+10:00

if i’m not seeing that message does it mean there is an app on my computer interfering with anki? this is what i am seeing
image

For me it worked when I opened Anki in the Program Files Folder and manually deleted th python38.dll
Afterwards I installed a newer package of Python and it worked just fine, no issues whatsoever.

bbb: if you use your computer’s find files feature to search for python38.dll, what does it show?

my computer had python 3.9 for anki, when i search for python3.8dll no files match my search.
i tried to install a more updated python which was 3.11 but anki wouldn’t open as it said it couldn’t work with that python update

You shouldn’t need to install Python yourself, as Anki comes bundled with it. What does the following print in Anki’s debug console?

pp(sys.path)

https://docs.ankiweb.net/misc.html#debug-console

Also, do you have a pythoncom38.dll file anywhere on your computer?

when i type that into the anki debug console this is what is pasted:

pp(sys.path)
[‘C:\Users\elsie\AppData\Roaming\Anki2\addons21’,
‘C:\Program Files\Anki\lib’,
‘C:\Program Files\Anki’,
‘C:\Program Files\Anki\lib\win32’,
‘C:\Program Files\Anki\lib\win32\lib’,
‘C:\Program Files\Anki\lib\Pythonwin’]

also, i dont have pythoncom38.dll file anywhere on my computer, is is something I should download?

thanks so much for helping me with this also

Hmm, are there any files in the C:\Users\elsie\AppData\Roaming\Anki2\addons21 folder? If so, does removing them or moving them somewhere else make a difference?

when I search that folder, it is empty. I think that I disabled my add ons (I had image occlusion enhanced) when trying to open anki when the issue first started as I held shift when opening the app, and when to tools > add ons to disable them to see if it would help.

I’m afraid I’m not sure what’s causing this at this point :frowning: I tried installing Python 3.8 in case a separate copy of Python on the path would cause this, but wasn’t able to reproduce the problem.

@Rumo win32com is only imported in tts.py by the looks of it, so if we skip the legacy SAPI TTS support, it may resolve this. It’s been kept around because I believe there may be some voices that are available via SAPI but not the newer winrt libraries. Maybe we could either gate it behind an env var, or catch the import error and skip initializing it?

After having left it alone for a few days, I tried re-importing the file of my cards and I can now access them. Im not sure what it was that helped but something defintley did. Thank you so so much for helping you have been a life saver

Since both reports have been resolved and we won’t be able confirm if a potential fix work currently, do we leave things as they are then?
I couldn’t find any indication that SAPI might have any voices WinRT hasn’t. Maybe we should just drop SAPI (at least for Win 10 Oct 18) and wait if there are any angry reports? :wink:

I think it mainly applies to third-party TTS engines that users have installed. Here’s a page that mentions the issue:

I’ve seen a lot more than two cases of this issue, so I think we do need a fix. I’ll start by just allowing the import to fail which will hopefully resolve the problem. We could potentially put this behind an env var to get a feel for how much it’s still used, though that will make life harder for any users still using this, and I suspect there still are some.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.