报错

写了一个脚本,大佬非要打包成exe给他,所以使用pyinstallerpython脚本编译成exe,结果在windows上运行的时候报dll找不到。
解决pyinstaller报错丢失api-ms-win-crt-runtime-11-1-0.dll

解决

pyinstaller -p C:\Windows\System32\downlevel --onefile xxx.py

注:
报错是因为打包时缺失了api-ms-win-crt-runtime-11-1-0.dll这类的dll文件,而它就存放在C:\Windows\System32\downlevel里,因此加上 -p参数在打包的时候添加该引用路径就好了。

文章目录