Running Anki from a Flash Drive

Having installed Anki 25.07.5 and followed the instructions in order to run Anki as a portable application, I found that the script “anki.bat” doesn’t work.

Actually I created the folder “Anki” in the folder “Anki25_07_5” in the USB drive L, so I edited the text file as follows:

l:\Anki25_07_5\Anki.venv\scripts\pythonw -c ‘import aqt; aqt.run()’ -b l:\Anki25_07_5\Anki\ankidata

Have I done something wrong?

Thank you!

2 Likes

Where exactly did you put the files? Maybe you put it at l:\Anki25_07_5\\Anki\.venv\scripts\pythonw instead? Basically make sure your paths are correct. And if you can’t figure it out, please post the exact error instead of saying that it “it doesn’t work”.

1 Like

I copied the files of the AnkiProgramFiles folder to the folder l:\Anki25_07_5\\Anki of the flash drive and created the text file anki.bat with the text l:\Anki25_07_5\Anki\.venv\scripts\pythonw -c 'import aqt; aqt.run()' -b l:\Anki25_07_5\Anki\ankidata. But, after running it, nothing happens. That’s what I mean saying “it doesn’t work”. What is the exact error that I am supposed to post? Is the text I wrote in the anki.bat wrong?
Thank you!

I tried it on mine too, and nothing happens!

start /b g:\anki\anki.exe -b g:\ankidata

This is what the manual used to suggest. It still works in the latest beta version. Version ⁨25.08b5 (d4862e99)⁩

Thanks, I’ll try that.
By the way, does this also work for addons?
And how do you update to a new version afterwards?

Yes, that used to be the case, but the new instructions have changed the structure of the anki.bat text file. I tried adding start /b in front, but again nothing happened.

What exactly have you tried? Write the full instructions.

I wrote start /b l:\Anki25_07_5\Anki\.venv\scripts\pythonw -c 'import aqt; aqt.run()' -b l:\Anki25_07_5\Anki\ankidata, but it didn’t work.
Instead the instructions in Anki manual (unfortunately I am not allowed to add links in my posts here) are the followings:

Running from a Flash Drive

On Windows, Anki can be installed on a USB / flash drive and run as a portable application. The following example assumes your USB drive is drive G. Please ensure you’ve read the Program Files section above first.

  • Copy the AnkiProgramFiles folder to the flash drive, so you have a folder like G:\Anki.
  • Create a text file called G:\anki.bat with the following text:g:\anki\.venv\scripts\pythonw -c 'import aqt; aqt.run()' -b g:\ankidata
  • Double-clicking on anki.bat should start Anki with the user data stored in G:\\ankidata.

I’ve pushed an update to the manual. If you replace the single quotes with double quotes, , it should fix the issue.

@Keks the approach you’re suggesting stores files on the local machine, instead of the flash drive

Thank you very much!

How can I upgrade the portable version when a new version of ANKI is released?

I installed installed Anki 25.07.5 and followed the instructions in order to run Anki as a portable application, followed the instructions in the manual, as well as the topic Not able to install using "anki-launcher-25.07.5-windows" .

I copied the AnkiProgramFiles to the flash drive and created a bat with the command
start /b D:\AnkiProgramFiles.venv\scripts\pythonw -c “import aqt; aqt.run()” -b D:\AnkiData

When trying to run the app from the flash drive in any computer that do not have the normal local install, I receive the error message “did not find executable at ‘C:Users\XXXX\AppData\Local\AnkiProgramFiles\python\cpython-3.13.5-windows-x86-none\pythonw.exe”

Did you also look at the solutions here – Running Anki from a Flash Drive ? Or is this already digested into the instructions you followed from the manual?

I’m asking because I do not know. Should that be AnkiProgramFiles\.venv instead?

Yes, I mistyped the command line that I used in the previous post, I followed the instructions after the updated version was up in the manual, and used the command start /b D:\AnkiProgramFiles.venv\scripts\pythonw -c “import aqt; aqt.run()” -b D:\AnkiData

Then I think if you correct that command, it will work.

No, i meant i used the correct command in the post here in the forum, but used the correct one in the Batch file. The error is still there with the correct command line

If you’re sure you’ve tried this with the correct suggested command, then I’ll merge this into the other thread.

[And it would probably be useful for you to paste the exact text of what you’ve tried that hasn’t worked, since what you’ve posted so far isn’t that.]

I deleted Anki from my computer, after having copied AnkiProgramFiles folder to a flash drive and having seen that it runs well, as I mentioned above. But today, I can’t open Anki from the flash drive and I take this message:

It seems that Anki is looking for the luncher… So, do I have to keep Anki installed on my computer? Is there any way to install the luncher in the flash drive? Otherwise it’s not portable…

Thank you!

  • Are you sure the batch file you’re running is correct?
  • Have you tried running (the operative part of) the command directly on the command line instead of from the batch file?
  • Did you uninstall Anki from your computer, or just “delete” it? [I’m wondering if there are environment variables/registry entries/etc. that are intervening behind the scenes.]
  • Have you tried this same flash drive method on another computer that hasn’t had Anki installed on it?