0

我正在使用 tabula 读取 pdf 表,但得到文件未找到错误,我尝试使用 chardet ( https://pypi.org/project/chardet/#files ) 查找是否有任何编码问题,但编码为 None .

from tabula import read_pdf
from tabulate import tabulate
df = read_pdf('C:\\Users\\YQ\IPA.pdf')
df

FileNotFoundError Traceback(最近一次调用最后)~\Anaconda3\lib\site-packages\tabula\wrapper.py in read_pdf(input_path, output_format, encoding, java_options, pandas_options, multiple_tables, **kwargs) 107 try: --> 108 output = subprocess.check_output(args) 109

~\Anaconda3\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs) 388 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, --> 389 **kwargs).stdout 390

~\Anaconda3\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs) 465 --> 466 with Popen(*popenargs, **kwargs) as process: 467 try:

~\Anaconda3\lib\subprocess.py in init(self、args、bufsize、可执行文件、stdin、stdout、stderr、preexec_fn、close_fds、shell、cwd、env、universal_newlines、startupinfo、creationflags、restore_signals、start_new_session、pass_fds、编码、错误,文本)768 errread,errwrite,--> 769 restore_signals,start_new_session)770 除了:

~\Anaconda3\lib\subprocess.py in _execute_child(self,args,executable,preexec_fn,close_fds,pass_fds,cwd,env,startupinfo,creationflags,shell,p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite,unused_restore_signals,unused_start_new_session) 1171
os.fspath(cwd) 如果 cwd 不是 None else None, -> 1172 startupinfo) 1173 最后:

FileNotFoundError: [WinError 2] 系统找不到指定的文件

在处理上述异常的过程中,又出现了一个异常:

----> 1 df = read_pdf('C:\Users\YQ\IPA.pdf') 2 df 中的 JavaNotFoundError Traceback(最近一次调用最后一次)

~\Anaconda3\lib\site-packages\tabula\wrapper.py in read_pdf(input_path, output_format, encoding, java_options, pandas_options, multiple_tables, **kwargs) 109 110 除了 FileNotFoundError as e: --> 111 raise JavaNotFoundError(JAVA_NOT_FOUND_ERROR) 112 113 除了 subprocess.CalledProcessError 作为 e:

JavaNotFoundError:java从这个 Python 进程中找不到命令。请确保已安装 Java 并设置了 PATHjava

4

0 回答 0