标签: pdftables

AttributeError:模块“集合”没有属性“可迭代”

我正在使用“pdftables”库从 pdf 中提取表格。

这是我的代码:

import pdftables

pg = pdftables.get_pdf_page(open("filename.pdf","rb"),253)

print(pg)

table = pdftables.page_to_tables(pg)

print(table)
Run Code Online (Sandbox Code Playgroud)

我收到此错误,但我不确定是什么原因造成的。

Traceback (most recent call last):
  File "c:\Users\gayak\OneDrive\Documents\PDF to Database\PDF_to_Tables_3.py", line 9, in <module>
    table = pdftables.page_to_tables(pg)
  File "C:\Users\gayak\AppData\Local\Programs\Python\Python310\lib\site-packages\pdftables\pdftables.py", line 485, in page_to_tables
    box_list = LeafList().populate(page, flt).purge_empty_text()
  File "C:\Users\gayak\AppData\Local\Programs\Python\Python310\lib\site-packages\pdftables\tree.py", line 98, in populate
    for obj in children(pdfpage):
  File "C:\Users\gayak\AppData\Local\Programs\Python\Python310\lib\site-packages\pdftables\tree.py", line 75, in children
    if isinstance(obj, collections.Iterable):
AttributeError: module 'collections' has no attribute 'Iterable'
Run Code Online (Sandbox Code Playgroud)

我使用的python版本是python 3.10.4

我以前pip install pdftables.six去图书馆

python pdf attributeerror pdftables

4
推荐指数
1
解决办法
8839
查看次数

标签 统计

attributeerror ×1

pdf ×1

pdftables ×1

python ×1