类型错误:localize_file() 采用 1 个位置参数,但给出了 2 个

问题描述

我正在使用 tabula-py 库从 pdf 文件提取表格。 使用脚本时出现错误

import tabula
file = "test_table.pdf"
table1 = tabula.read_pdf(file,pages='all',multiple_tables = True)

错误

回溯(最近一次调用最后一次):

File "<ipython-input-17-caafa01b0ee6>",line 1,in <module>
    runfile('C:/Users/Documents/files/test_sample/tabulank.py',wdir='C:/Users/Documents/files/test_sample')

  File "C:\Users\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py",line 705,in runfile
    execfile(filename,namespace)

  File "C:\Users\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py",line 102,in execfile
    exec(compile(f.read(),filename,'exec'),namespace)

  File "C:/Users/Documents/files/test_sample/tabulank.py",line 9,in <module>
    table1 = tabula.read_pdf(file,multiple_tables = True)

  File "C:\Users\Anaconda3\lib\site-packages\tabula\io.py",line 287,in read_pdf
    **path,temporary = localize_file(input_path,user_agent)**

TypeError: localize_file() takes 1 positional argument but 2 were given

请建议如何消除此错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)