Failed installation

Hello, I get the following error when installing ANKI

Anki Launcher

  1. Latest Anki (press Enter)

  2. Choose a version

  3. Allow betas: off

  4. Cache downloads: on

  5. Download mirror: off

  6. Uninstall

1

Checking for updates…
Unable to check for Anki versions. Please check your internet connection.

Error: Failed to run (2): C:\Users\Andrew\AppData\Local\Programs\Anki\uv.exe run --no-project --no-config --managed-python --with pip-system-certs,requests[socks] --python 3.13.5 C:\Users\Andrew\AppData\Local\Programs\Anki\versions.py: error: Querying Python at C:\Users\Andrew\AppData\Roaming\uv\python\cpython-3.13.5-windows-x86_64-none\python.exe failed with exit status exit code: 1

[stderr]
Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
File “”, line 0
SyntaxError: source code string cannot contain null bytes

Current thread 0x0000626c (most recent call first):

Press enter to close…

Here is my Windows: spec

Edition Windows 11 Home
Version 25H2
Installed on ‎30/‎12/‎2025
OS build 26200.7623
Experience Windows Feature Experience Pack 1000.26100.275.0

My computer is connected to the internet for sure, that’s how I posted this message!

1 Like

You should search for recent posts with similar launcher errors, and try everything in those threads.

https://forums.ankiweb.net/search?q=Error%3A+Failed+to+run

That thread has no solutions! This is a complicated installer because it runs a script, so it will be hard to diagnose the underlying problem

There are many threads with many solutions offered. You should try them all.

Here is the solution. Avoid broken installer and revert to an earlier release:

https://github.com/ankitects/anki/releases/tag/25.02.7

This is software for language learner. You shouldn’t need a PhD in windows security to install it. Being “free” is no excuse and actually illustrates the problem with free software. If we were paying for it (I would be happy to) then we’d have a right to a functional installer, and the author would have a financial incentive to make the installer work for everybody.

1 Like

You should know it works fine for most people. Your issue can only be solved if affected people like you give proper steps to reproduce and do proper debugging / testing.

You don’t, obviously. Paid software would have the same issue if noone can find the underlying issue that makes the launcher error out in a fraction of users.

That’s not a solution, that’s a workaround. Good you got it working but there obviously won’t be any way for devs to fix the issue if the underlying issue in your machine is unknown. It could be everything, including that not Anki is at fault but the users setup instead.

Also, maybe your python installation is at fault. You could try if python works fine if called via command line or remove and reinstall python if you really wish to help debug this.

I found a possible cause of the issue. Try this:

  1. Go to the Environment Variables screen under System Properties (Google).
  2. Search for a variable named PYTHONHOME under User variables and System variables. Delete the variable or rename it to something else temporarily.
  3. Run the installer again.

Tracked here: Installer fails if invalid PYTHONHOME is set? · Issue #4523 · ankitects/anki · GitHub

1 Like

Hello, I typed “python” at the command prompt and it took me to the windows store to download it. If a dev can give me a script to run on my machine that will generate useful error messages, I’ll take a look.

I don’t particularly want Python installed on my machine anyway.

You don’t need to have Python installed. See my comment above.

On my system there is no PYTHONHOME or other PYTHON environment variable

Do you have this folder?
C:\Users\Andrew\AppData\Roaming\uv\python\cpython-3.13.5-windows-x86_64-none

What do you see if you run the python.exe executable inside? If you see some errors, delete the whole folder and rerun the installer.

The folder is there. When I run python.exe nothing happens in the terminal window and no errors are reported but the Microsoft store app opens offering me the opportunity to download Python.

I deleted that folder, re-downloaded ANKI, but the installer still fails

Anki Launcher

  1. Latest Anki (press Enter)

  2. Choose a version

  3. Allow betas: off

  4. Cache downloads: on

  5. Download mirror: off

  6. Uninstall

1

Checking for updates…
Unable to check for Anki versions. Please check your internet connection.

Error: Failed to run (1): C:\Users\Andrew\AppData\Local\Programs\Anki\uv.exe run --no-project --no-config --managed-python --with pip-system-certs,requests[socks] --python 3.13.5 C:\Users\Andrew\AppData\Local\Programs\Anki\versions.py: Downloading cpython-3.13.5-windows-x86_64-none (download) (20.1MiB)
Downloading cpython-3.13.5-windows-x86_64-none (download)
Error processing line 1 of C:\Users\Andrew\AppData\Local\uv\cache\archive-v0\5y1_YRgTLo8mdgEkcUwNU\Lib\site-packages_virtualenv.pth:

Traceback (most recent call last):
File “”, line 207, in addpackage
File “”, line 1, in
SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of C:\Users\Andrew\AppData\Local\uv\cache\archive-v0\5y1_YRgTLo8mdgEkcUwNU\Lib\site-packages\pip_system_certs.pth:

Traceback (most recent call last):
File “”, line 207, in addpackage
File “”, line 1, in
SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of C:\Users\Andrew\AppData\Local\uv\cache\archive-v0\5y1_YRgTLo8mdgEkcUwNU\Lib\site-packages_virtualenv.pth:

Traceback (most recent call last):
File “”, line 207, in addpackage
File “”, line 1, in
SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of C:\Users\Andrew\AppData\Local\uv\cache\archive-v0\5y1_YRgTLo8mdgEkcUwNU\Lib\site-packages\pip_system_certs.pth:

Traceback (most recent call last):
File “”, line 207, in addpackage
File “”, line 1, in
SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Traceback (most recent call last):
File “C:\Users\Andrew\AppData\Local\Programs\Anki\versions.py”, line 7, in
import pip_system_certs.wrapt_requests
SyntaxError: source code string cannot contain null bytes

Press enter to close…

I’m not familiar with Windows, Python, or uv, but would deleting the uv cache be something useful to try? On the OP’s system the cache appears to be C:\Users\Andrew\AppData\Local\uv\cache.

(From the most recent set of error messages, it seems that python might be having trouble processing two cache files, perhaps finding them to be null files or to have null characters in them.)

1 Like

Isn’t the path where Anki’s uv cache files are saved C:\Users\username\AppData\Local\AnkiProgramFiles? C:\Users\username\AppData\Local\uv\cache seems to be the cache for uv installed on the PC, I think Anki probably doesn’t use it. (but I didn’t develop the launcher, so I don’t know exactly.)

Is the launcher you’re using the latest version? The old launcher had some bugs and I think the new launcher has fixed them. The launcher probably won’t update itself so users of the old launcher will need to download it manually.

On my Mac, I saw that there were two cache directories containing uv cache files:

  1. ~/Library/Application Support/AnkiProgramFiles/cache
  2. ~/.cache/uv

Cache 1 contained directories created up through September 2025, while Cache 2 contained directories created in October and December 2025. So, it looks as if Anki might have switched cache locations sometime around September/October 2025.

I then deleted both cache directories, ran Anki, and selected Tools → Upgrade/Downgrade to get the Anki Launcher terminal menu. I selected option “#3 Keep existing version (25.09.2)” to exit. At that point, I observed that the Cache 2 directory was re-created while the Cache 1 directory was not.

So, on Mac it appears that the Anki Launcher (25.09) no longer uses the AnkiProgramFiles directory for its cache location. I imagine that the situation might be similar on Windows systems?

1 Like

@Anding To confirm if it’s a caching issue, you can disable and clear the cache by pressing 6 when running the launcher.

This is fixed in fix(launcher): apply cache settings to all uv invocations by iamllama · Pull Request #4404 · ankitects/anki · GitHub

No launcher release includes the fix though yet.