我创建了一个脚本来使用 tabula-py 和 PyPDF2 从 pdf 中提取数据。当我通过 Jupyter-notebook 和 cmd 运行我的程序时,它运行良好。使用 pyinstaller 将其转换为可执行文件后,出现此错误:
Error: Unable to access jarfile
E:\Users\paulhong\AppData\Local\Temp\_MEI175522\tabula\tabula-1.0.2-jar-with-dependencies.jar
Error:
Traceback (most recent call last):
File "test.py", line 115, in <module>
File "test.py", line 32, in extractDataDik
tempDf = tabula.read_pdf(file, area = (72, 252, 115.2, 352.8), guess=False, pages='1')
File "site-packages\tabula\wrapper.py", line 108, in read_pdf
File "subprocess.py", line 395, in check_output
File "subprocess.py", line 487, in run
subprocess.CalledProcessError: Command '['java', '-Dfile.encoding=UTF8', '-jar',
'E:\\Users\\paulhong\\AppData\\Local\\Temp\\_MEI175522\\tabula\\tabula-1.0.2-jar-with-dependencies.jar', '--pages', '1', '--area',
'72,252,115.2,352.8', 'E:\\Users\\paulhong\\Desktop\\Purchase Order
2\\SKM_C45819060508450 (003).pdf']' returned non-zero exit status 1. [47140] Failed to execute script test
我也找不到指定路径上的文件夹 _MEI175522。
我的python版本是3.7.1 Java版本是1.8 pyinstaller版本是3.4 Tabula-py是最新版本
我该如何解决这个问题?