直接运行代码时,代码正常运行。
写完python代码打包exe时正常,exe运行时报警。报警详情如下图
打包为exe的时候tabula包没有打包进去,因此报错
3.解决方案在打包exe时生成的xxx.spec 文件中添加
from PyInstaller.utils.hooks import collect_data_files
和
datas=collect_data_files("tabula"),
然后运行(注意:不要再运行pyinstaller ResolutionPDF.py,不然xxx.spec重新生成,之前的配置就没有生效了)
pyinstaller ResolutionPDF.spec
打包后的exe可以正常运行



