
pyinstaller 生成exe文件运行后报错:ImportError: DLL load failded 200
用pyinstaller将脚本打包运行后报错:ImportError:DLLloadfailded找不到指定的模块使用的Python脚本如下,只是做测试用,用于验证导入相...
用pyinstaller 将脚本打包运行后报错:ImportError: DLL load failded 找不到指定的模块使用的Python脚本如下,只是做测试用,用于验证导入相关包后使用pyinstaller是否有问题:test.py:import numpy as npimport gensimimport scipyprint 'a'print np.mat([1])打包命令: pyinstaller -F test.py如图打包运行后结果以及打包过程中会提示lib not found使用pyinstaller -F test.py -p C:\Python27\Lib\site-packages\scipy打包,则打包过程中报错如图 'str' object have no attribute 'items'
展开
3个回答
展开全部
简便方案:只需在代码中引用以下几个模块,封装时Pyinstaller即可自动引用,无需再次手动拷贝。
亲测封装成单文件/非单文件都已成功,省去了要封装成多文件还要往里拷贝的麻烦。我的程序不带这五个dll文件是9MB,如此一来变成23M,也不会再有pyi_rth_qt5plugins错误。
import ctypestry:
temp1=ctypes.windll.LoadLibrary( 'DLL\\Qt5Core.dll' )
temp2=ctypes.windll.LoadLibrary( 'DLL\\Qt5Gui.dll' )
temp3=ctypes.windll.LoadLibrary( 'DLL\\Qt5Widgets.dll' )
temp4=ctypes.windll.LoadLibrary( 'DLL\\msvcp140.dll' )
temp5=ctypes.windll.LoadLibrary( 'DLL\\Qt5PrintSupport.dll' )except:
pass
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询