【发布时间】:2022-01-19 13:14:53
【问题描述】:
对于我的应用程序,我使用 tabula 包将 pdf 转换为 csv。我写的云函数是在python3.7中的。我把它写在 requirements.txt 文件中。但是我收到了这个错误
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/tabula/io.py", line 91, in _run raise JavaNotFoundError(JAVA_NOT_FOUND_ERROR) tabula.errors.JavaNotFoundError: `java` command is not found from this Python process.Please ensure Java is installed and PATH is set for `java`
需求文件
tabula-py==1.4.1
main.py
import tabula
df = tabula.read_pdf('/tmp/' + file_id +'.pdf', pages = required_page)[0]
tabula.convert_into('/tmp/' + file_id +'.pdf', '/tmp/' + file_id +'.csv',output_format="csv",pages=required_page, stream=False)
我该如何解决这个问题?有什么替代方法吗?
【问题讨论】:
-
我也试过1.3.1版本,同样的错误
-
我试过 Camelot,但这需要 Ghostscript。
标签: python-3.x google-cloud-functions tabula-py