2017-07-27 143 views
0

我不斷收到此錯誤。我的工作 -Python tabula模塊中的這個錯誤是什麼?

的Mac塞拉利昂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") 

UPDATE:

當我嘗試做from tabula import wrapper我得到個錯誤:

ImportError: cannot import name 'wrapper' 

UPDATE:

按@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. 
+0

我有很多的代碼怎麼回事,但我試圖把這個另一臺計算機上,並不斷收到錯誤消息。 – sgerbhctim

回答

2

我懷疑你沒有pip install tabula,裏面裝的是有一個版本1.0.5一個tabula庫。這裏是the github repo。它沒有一個convert_into功能

但你其實是要安裝this tabula,其最新版本爲0.9.0

您應該pip uninstall tabulapip3 install tabula-py

+0

非常感謝。我真是個白癡 - 哈哈。 – sgerbhctim

+0

不客氣,它一直在發生。 –

+0

我還有一個錯誤 - 更新後 – sgerbhctim