我正在尝试从发票中读取一些数据。
我的test.py
from invoice2data import extract_data
from invoice2data.extract.loader import read_templates
templates = read_templates('template/a.pdf')
print(templates)
result = extract_data('Invoice/a.pdf', templates=templates)
print(result)在这里,我的基本文件夹具有以下结构:
|template
| | a.pdf
|
|Invoice
| | a.pdf
|
|test.py但它显示以下错误:
[]
I/O Error: Couldn't open file 'Invoice/a.pdf': No such file or directory.
False
No template for Invoice/a.pdf
[Finished in 1.399s]我怎么才能修复它?我必须使用invoice2data 0.3.5
发布于 2021-04-08 20:40:12
您需要将目录放入。
模板= read_templates('template/a.pdf')
尝试将路径放入该区域。(r'{PATH}')
或者在编辑器中生成文件。
https://stackoverflow.com/questions/67004139
复制相似问题