问题描述
我试图在Ubuntu操作系统中使用python3从.pdf文件中以UTM格式提取地理坐标,并使用以下代码:
from pathlib import Path
import textract
import numpy as np
import re
import os
import pdfminer
def main(_file):
try:
text = textract.process(_file,method="pdfminer")
except textract.exceptions.ShellError as ex:
print(ex)
return
with open("%s.csv" % Path(_file).name[: -len(Path(_file).suffix)],"w+") as _file:
# find orders and DNIs
coords = re.compile(r"\d?\.?\d+\.+\d+\,\d{2}")
results = re.findall(coords,text.decode())
if results:
_file.write("|".join(results))
if __name__ == "__main__":
_file = "/home/cristian33/python_proj/folder1/buscarco.pdf"
main(_file)
当我运行它时,出现以下错误:
命令pdf2txt.py /home/cristian33/python_proj/folder1/buscarco.pdf
失败,因为可执行文件
pdf2txt.py
未安装在您的系统上。请做出来
确保在使用之前安装了适当的依赖项
textract:
http://textract.readthedocs.org/en/latest/installation.html
有人知道为什么会出错吗?
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)