1 未找到隐藏的导入 xxxx
直接 pip install xxx 或者 检查是否是自己自定义的包
2 error loading python dl
pyinstaler --clean --win-private-assemblies -f xxxx.py
3 回溯(最近一次调用最后一次): 文件“XXXXX.py”,第3行,在<module> 文件“d:\ python \ python36 \ lib \ site-packages \ PyInstaller \ loader \ pyimod03_importers.py”,第714页行,load_module module = loader.load_module(fullname) ModuleNotFoundError:没有名为‘PyQt5.sip‘的模块 [18720]无法执行脚本qt_control_24
【解决】pyinstaller指令中加入: - hidden-import PyQt5.sip
【解决】在主程序中导入PyQt5.sip
4 程序中有Multiprocessing的引用
在打包成可执行程序后会创建进程失败。
【解决】(转自:dexterchen)
one-directory模式,只要再程序的最开始调用multiprocessing. freeze_support()就可以了
注意!!!!一定要写在
if __name__ == ‘__main__‘:里,否则就会出现 can not get ‘模块‘ from 的错误one-file模式,还需要使用下面修改后的Process和Pool。
查看更多关于pyinstaller 常见错误及解决办法的详细内容...