无法访问 jarfile 'tabula-1.0.2-jar-with-dependencies.jar' [英] Unable to access jarfile 'tabula-1.0.2-jar-with-dependencies.jar'

查看:42
本文介绍了无法访问 jarfile 'tabula-1.0.2-jar-with-dependencies.jar'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 pyinstaller 作为 pyinstaller --onefile script.py 制作了一个 python 可执行文件.当我运行 script.exe 时,出现以下错误:

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

我正在使用 tabula-py 包来解析 pdf 表.脚本没有错误并且运行完美.谢谢!

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

推荐答案

这个问题显然是因为上面提到的jar文件没有正确添加到dist文件夹结构中.

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

我想一个基本的解决方案需要开发人员进行一些修改,但这里可能的解决方法是使用选项 --add-data 选项将 jar 文件包含到文件夹中叫做tabula,所以像

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.

这篇关于无法访问 jarfile 'tabula-1.0.2-jar-with-dependencies.jar'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆