gpt4 book ai didi

python - Python tabula 模块中的这个错误是什么?

转载 作者:行者123 更新时间:2023-11-28 21:40:42 38 4
gpt4 key购买 nike

我一直收到这个错误。我正在研究 -

苹果塞拉利昂 10.8

python 3.6.2

表格 1.0.5

Traceback (most recent call last):
File "/Users/Sam/Desktop/mitch test/test.py", line 22, in <module>
tabula.convert_into(root.fileName, "_ExportedPDF-" + date_time + ".csv", output_format="csv", pages="all")
AttributeError: module 'tabula' has no attribute 'convert_into'

这是给我错误的代码。

tabula.convert_into(root.fileName, "_ExportedPDF-" + date_time + ".csv", output_format="csv", pages="all")

更新:

当我尝试执行 from tabula import wrapper 时出现错误:

ImportError: cannot import name 'wrapper'

更新:

根据@L 修正评论。阿尔瓦雷斯

出现以下错误:

Traceback (most recent call last):
File "/Users/Sam/Desktop/mitch test/test.py", line 22, in <module>
tabula.convert_into(root.fileName, "_ExportedPDF-" + date_time + ".csv", output_format="csv", pages="all")
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tabula/wrapper.py", line 140, in convert_into
subprocess.check_output(args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['java', '-jar', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tabula/tabula-0.9.2-jar-with-dependencies.jar', '--pages', 'all', '--guess', '--format', 'CSV', '--outfile', '_ExportedPDF-Jul 26 2017.csv', '/Users/Sam/Desktop/mitch test/security_by_curr_risk_ldw.pdf']' returned non-zero exit status 1.

最佳答案

我怀疑您执行了 pip install tabula,它安装了一个版本为 1.0.5 的 tabula 库。这是 the github repo .它没有 convert_into 函数

但你实际上是想安装 this tabula , 最后一个版本是 0.9.0

您应该pip uninstall tabulapip3 install tabula-py

关于python - Python tabula 模块中的这个错误是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45340256/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com