Unable to access jarfile 'tabula-1.0.2-jar-with-dependencies.jar'

故事扮演 提交于 2020-01-23 03:35:06

问题


I made a python executable using pyinstaller as pyinstaller --onefile script.py. When I run the script.exe, I get the following errors:

I am using tabula-py package to parse a pdf table. Script has no bugs though and is running pefect. Thanks!


回答1:


This problem is apparently caused because the above mentioned jar file is not added to the dist folder structure properly.

I guess a fundamental solution would require some modifications from the side of the developers, but a possible workaround here is to use the option --add-data option to include the jar file into a folder called tabula, so something like

pyinstaller --add-data path:\to\tabula-(...).jar; tabula 

in order to make it run, or set something like

datas=[('path:\to\tabula-(...).jar', 'tabula')],

into the spec file. Made both regular builds and one-file-builds runnable for me.



来源:https://stackoverflow.com/questions/50544515/unable-to-access-jarfile-tabula-1-0-2-jar-with-dependencies-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!