api-ms-win-crt-runtime-l1-1-0.dll is missing

86 views
Skip to first unread message

Sandeep Periwal

unread,
Jul 31, 2020, 6:24:28 AM7/31/20
to PyInstaller
Base OS: Windows 10
Python: 3.7.7
Pyinstaller: 3.6

Executable does not run on some versions of Windows 7. I get the following error.

This program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the prorgram to fix this problem.

There are lot of posts on various forums suggesting installing Visual Studio 2015 -- but it did not help.

Has anyone solved this issue? If yes, please suggest a solution.

Thanks

bwoodsend

unread,
Jul 31, 2020, 8:03:30 AM7/31/20
to PyInstaller

You’ll need to add that missing dll to your app when building on Windows 10 if you want it to work on Windows 7. To do this:

First locate that dll. Use where api-ms-win-crt-runtime-l1-1-0.dll. It’s a system dll so it’s probably in the same place for everyone. Mine is at C:\Windows\System32\api-ms-win-crt-runtime-l1-1-0.dll.

Second add it to your package. If you’re using --onedir mode you can actually just copy/paste it in but this isn’t recommended for anything other than a quick experiment. To do it properly add --add-binary C:\Windows\System32\api-ms-win-crt-runtime-l1-1-0.dll;. to your PyInstaller xxx.py command (alter the path to the dll if yours differs).
Or if you use the spec file add binaries=[(shutil.which("api-ms-win-crt-runtime-l1-1-0.dll"), ".")] to the a = Analysis(...) section.

Sandeep Periwal

unread,
Jul 31, 2020, 8:31:52 AM7/31/20
to PyInstaller
@bwoodsend Thanks for your detailed reply.
I searched my computer and specifically C:\Windows\System32\api-ms* I don't have api-ms-win-crt-runtime-l1-1-0.dll. Is that odd?
What source would you recommend I download it from?

bwoodsend

unread,
Aug 3, 2020, 1:40:45 PM8/3/20
to PyInstaller

Not even on your Windows 10? That is odd. Do you know if a specific library is using it or if just a hello-world PyInstaller build gives that error? In theory you shouldn’t be able to run your code normally without it. I notice Conda brings a copy of that dll with it (actually it has it twice for some reason). If you are using Conda then conda activate before calling where ....

If you do have to download it you can check it’s genuine using the sha code. The ones I have hash to ( using certUtil -hashfile api-ms-win-crt-runtime-l1-1-0.dll ) a19acefa3f95d1b565650fdbc40ef98c793358e9 and f67bc165cefb119ad767b6bec27a1102c0fd2bac so I can vouch for anything that matches either of those. You can probably find a list somewhere on a Microsoft page somewhere…

rscl....@gmail.com

unread,
Oct 3, 2020, 3:07:43 AM10/3/20
to PyInstaller
SOLVED!!!!!
For anyone facing this issue, please download a small patch from this link (for windows 7).

Refer this link:
Reply all
Reply to author
Forward
0 new messages