我一直遇到这个错误。我正在使用 -
Mac Sierra 10.8
Python 3.6.2
tabula 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. Alvarez的评论已修正。
遇到以下错误:
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.