面对以下问题:有人能帮忙吗?请
在尝试从PDF提取表格数据时获取以下信息
import camelot
# PDF file to extract tables from
file = input_folder+file_name
tables = camelot.read_pdf(file)
# number of tables extracted
print("Total tables extracted:", tables.n)
# print the first table as Pandas DataFrame
print(tables[0].df)
Error: AttributeError: module 'camelot' has no attribute 'read_pdf'
我遇到了同样的问题,并尝试了很多事情,包括安装/卸载各种camelot软件包,克隆git等等。它对我不起作用。我发现这个问题与CV2有关。服务器(headless)环境没有安装GUI软件包,因此如果在没有GUI的服务器上使用Camelot,则应首先安装opencv python headless:
然后与camelot.io指令一起导入:
发生此错误的原因很可能是安装了错误的软件包
当您安装camelot模块时,您应该使用:
如果没有,请卸载您安装的软件包并使用上述命令
相关问题 更多 >
编程相关推荐