首页 » 信息技术 »

用pyinstaller时,出现lib not found: api-ms-win-crt-*

2019年9月23日 / 2次阅读
Python

在Win10系统中,使用pyinstaller打包Python程序,出现了一大堆这样的warning信息:(有点多哈,请直接往下翻即可,写blog的好处就是,没有长度限制)

D:\py\gps>pyinstaller -F --noconsole gps.py
1020 INFO: PyInstaller: 3.4
1020 INFO: Python: 3.7.3
1024 INFO: Platform: Windows-10-10.0.17763-SP0
1049 INFO: wrote D:\py\gps\gps.spec
1063 INFO: UPX is not available.
1065 INFO: Extending PYTHONPATH with paths
['D:\\py\\gps', 'D:\\py\\gps']
1065 INFO: checking Analysis
1065 INFO: Building Analysis because Analysis-00.toc is non existent
1065 INFO: Initializing module dependency graph...
1089 INFO: Initializing module graph hooks...
1150 INFO: Analyzing base_library.zip ...
5145 INFO: running Analysis Analysis-00.toc
5183 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\xinli\appdata\local\programs\python\python37\python.exe
5252 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python.exe
5293 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python.exe
5335 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python.exe
5378 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python.exe
5420 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python.exe
5516 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5559 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5616 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5657 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5708 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5750 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5802 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5844 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5886 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5928 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
5969 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
6010 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\python37.dll
6073 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\VCRUNTIME140.dll
6115 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\VCRUNTIME140.dll
6157 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\VCRUNTIME140.dll
6197 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\VCRUNTIME140.dll
6238 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\VCRUNTIME140.dll
6242 INFO: Caching module hooks...
6400 INFO: Analyzing D:\py\gps\gps.py
6591 INFO: Loading module hooks...
6591 INFO: Loading module hook "hook-encodings.py"...
6754 INFO: Loading module hook "hook-pydoc.py"...
6779 INFO: Loading module hook "hook-xml.py"...
7082 INFO: Loading module hook "hook-_tkinter.py"...
7133 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_tkinter.pyd
7177 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_tkinter.pyd
7220 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_tkinter.pyd
7383 INFO: checking Tree
7383 INFO: Building Tree because Tree-00.toc is non existent
7384 INFO: Building Tree Tree-00.toc
7739 INFO: checking Tree
7739 INFO: Building Tree because Tree-01.toc is non existent
7740 INFO: Building Tree Tree-01.toc
7783 INFO: Looking for ctypes DLLs
7783 INFO: Analyzing run-time hooks ...
7786 INFO: Including run-time hook 'pyi_rth__tkinter.py'
7808 INFO: Looking for dynamic libraries
7854 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_ssl.pyd
7900 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_ssl.pyd
7945 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_ssl.pyd
7995 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\pyexpat.pyd
8038 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\pyexpat.pyd
8079 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\pyexpat.pyd
8121 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\pyexpat.pyd
8162 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\pyexpat.pyd
8208 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_hashlib.pyd
8255 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_lzma.pyd
8297 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_lzma.pyd
8342 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_socket.pyd
8387 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_socket.pyd
8456 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\unicodedata.pyd
8498 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\unicodedata.pyd
8539 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\unicodedata.pyd
8586 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_bz2.pyd
8627 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_bz2.pyd
8669 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_bz2.pyd
8711 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_bz2.pyd
8753 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_bz2.pyd
8798 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\select.pyd
8847 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_tkinter.pyd
8891 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_tkinter.pyd
8934 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\_tkinter.pyd
9012 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9054 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9096 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9140 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9182 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9223 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9264 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9307 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9349 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libcrypto-1_1-x64.dll
9425 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libssl-1_1-x64.dll
9466 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libssl-1_1-x64.dll
9509 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libssl-1_1-x64.dll
9552 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\libssl-1_1-x64.dll
9628 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9670 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9712 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9754 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9806 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9848 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9891 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9940 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
9983 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tcl86t.dll
10066 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10109 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10160 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10212 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10254 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10297 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10340 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10385 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\xinli\appdata\local\programs\python\python37\DLLs\tk86t.dll
10385 INFO: Looking for eggs
10385 INFO: Using Python library c:\users\xinli\appdata\local\programs\python\python37\python37.dll
10386 INFO: Found binding redirects:
[]
10389 INFO: Warnings written to D:\py\gps\build\gps\warn-gps.txt
10416 INFO: Graph cross-reference written to D:\py\gps\build\gps\xref-gps.html
10482 INFO: checking PYZ
10482 INFO: Building PYZ because PYZ-00.toc is non existent
10483 INFO: Building PYZ (ZlibArchive) D:\py\gps\build\gps\PYZ-00.pyz
10831 INFO: Building PYZ (ZlibArchive) D:\py\gps\build\gps\PYZ-00.pyz completed successfully.
10838 INFO: checking PKG
10838 INFO: Building PKG because PKG-00.toc is non existent
10838 INFO: Building PKG (CArchive) PKG-00.pkg
13754 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
13778 INFO: Bootloader c:\users\xinli\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
13778 INFO: checking EXE
13779 INFO: Building EXE because EXE-00.toc is non existent
13779 INFO: Building EXE from EXE-00.toc
13800 INFO: Appending archive to EXE D:\py\gps\dist\gps.exe
13858 INFO: Building EXE from EXE-00.toc completed successfully.

这个Python程序有使用tkinter模块。

奇怪的是,虽然一推warning,提示找不到很多库文件,但是打包生成的exe程序,在别人的Win10系统中,能够正常运行。

找来找去,有人说要安装Microsoft Visual C++ Redis包,我在安装时,系统提示我的系统已经安装了此包,而且版本更新。

stackoverflow里,有人说设置一个环境变量:set PATH=%PATH%;C:\Windows\System32\downlevel; 不过,我没有测试这个方法,我找到了另一个解决之道:升级pyinstaller。

我安装的pyinstaller是3.4,现在最新的额3.5,升级: pip install --upgrade pyinstaller

然后重新运行打包的命令,一切OK,再无各种warning出现。

本文链接:https://www.maixj.net/ict/lib-not-found-22825

相关文章

留言区


前一篇:

栏目精选

云上小悟,麦新杰的独立博客

Ctrl+D 收藏本页

栏目


©Copyright 麦新杰 Since 2014 云上小悟独立博客版权所有 备案号:苏ICP备14045477号-1。云上小悟网站部分内容来源于网络,转载目的是为了整合信息,收藏学习,服务大家,有些转载内容也难以判断是否有侵权问题,如果侵犯了您的权益,请及时联系站长,我会立即删除。

网站二维码
go to top