sge*_*tim 2 python pandas tabula
我不断收到此错误。我正在努力-
Mac Sierra 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'
Run Code Online (Sandbox Code Playgroud)
这是我的代码,给我一个错误。
tabula.convert_into(root.fileName, "_ExportedPDF-" + date_time + ".csv", output_format="csv", pages="all")
Run Code Online (Sandbox Code Playgroud)
更新:
当我尝试做时,from tabula import wrapper出现错误:
ImportError: cannot import name 'wrapper'
Run Code Online (Sandbox Code Playgroud)
更新:
根据@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.
Run Code Online (Sandbox Code Playgroud)
我怀疑您这样做了pip install tabula,它安装了一个tabula具有1.0.5版本的库。这是github repo。它没有convert_into函数
但是您实际上打算安装此表格,其最新版本为0.9.0
你应该pip uninstall tabula和pip3 install tabula-py