PyInstaller-Perfect-Build-Method icon indicating copy to clipboard operation
PyInstaller-Perfect-Build-Method copied to clipboard

添加hook.py后,执行exe时很多dll找不到

Open tankchenggeng opened this issue 2 years ago • 2 comments

Traceback (most recent call last): File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_win32comgenpy.py", line 40, in File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module File "win32com_init_.py", line 8, in File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module File "pythoncom.py", line 2, in File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module File "pywintypes.py", line 126, in File "pywintypes.py", line 47, in import_pywin32_system_module ImportError: Module 'pywintypes' isn't in frozen sys.path ['D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist\libs', 'D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist\envs', 'D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist\envs\lib-dynload', 'D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist\envs\base_library.zip', 'D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist\base_library.zip', 'D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist\lib-dynload', 'D:\Server\Research\ModasPro_KEYAN_SAMPLE\dist'] [271392] Failed to execute script 'pyi_rth_win32comgenpy' due to unhandled exception!

以这个为例,添加hook.py后,原本存在于pywin32_system32目录下的dll必须手动移出来才找得到

tankchenggeng avatar Sep 01 '23 07:09 tankchenggeng

我也遇到了这个问题,win32 相关的库确实没找到怎么改。等等吧,等过一两个月,预计 Pyinstaller 6.0 就发布了,直接原生支持把杂七杂八汇总到一个文件夹。

HaujetZhao avatar Sep 01 '23 07:09 HaujetZhao

Pyinstaller 6.0.0 发布了,确实支持了默认把依赖单独拉到_internal文件夹下 不知道作者会不会基于6.0更新下教程(py外置 和 双exe部分)? ~(虽然已经在基于现有教程尝试自己改了,不过萌新落泪~ (已经模仿者搞定了,谢谢大佬教程

blyc avatar Sep 27 '23 10:09 blyc