简体   繁体   English

Pyinstaller 找不到 kernel32 dll

[英]Pyinstaller fails to find kernel32 dll

Currently trying to build a exe using PyInstaller.目前正在尝试使用 PyInstaller 构建一个 exe。 The installation goes fine, although when trying to run the exe an exception occurs安装顺利,虽然尝试运行exe时出现异常

Exception ignored in: <function Library.__del__ at 0x000002126637F160>
Traceback (most recent call last):
  File "C:\Users\blah\AppData\Local\Programs\Python\Python39\lib\site-packages\pylink\library.py", line 272, in __del__
  File "C:\Users\blah\AppData\Local\Programs\Python\Python39\lib\site-packages\pylink\library.py", line 390, in unload
  File "C:\Users\blah\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 444, in __getattr__
  File "PyInstaller\loader\pyimod04_ctypes.py", line 79, in __init__
pyimod04_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'kernel32'. Most likely this dynlib/dll was not found when the application was frozen.

I've followed the lead on some other posts and ensured the Visual C++ Redistributables are installed and also included --hidden-import ctypes in the build to no avail.我在其他一些帖子上跟随了领导,并确保安装了 Visual C++ Redistributables,并且还在构建中包含--hidden-import ctypes无济于事。

Building on Windows 10 - Python 3.9 - PyInstaller 5.0.1基于 Windows 10 - Python 3.9 - PyInstaller 5.0.1

Any help would be great!任何帮助都会很棒!

Taken from the comments on the original answer.取自对原始答案的评论。 Quote stevod :引用史蒂夫

I ended up finding the problem, our company anti virus wouldn't let the bootloader access the required files, so we had to rebuild the bootloader manually and then it worked!我最终找到了问题,我们公司的杀毒软件不允许引导加载程序访问所需的文件,所以我们不得不手动重建引导加载程序,然后它就可以工作了!

The same worked also for me.这对我也有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM