gpt4 book ai didi

python - Camelot python;OSError : exception: access violation writing 0x00000080

转载 作者:太空宇宙 更新时间:2023-11-03 20:14:42 25 4
gpt4 key购买 nike

我尝试使用 Camelot 从 PDF 文件中提取表格。

这是我的代码:

import camelot
tables = camelot.read_pdf('foo.pdf')
print(tables)

运行此脚本时出现错误,如下所示:

  File "C:/Users/gibin/PycharmProjects/ML/Table_Tester.py", line 20, in <module>
table=tables = camelot.read_pdf(r"C:\Users\gibin\PycharmProjects\ML\Doc_downloader\GWC_Docs\781313686.pdf")
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\io.py", line 117, in read_pdf
**kwargs
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\handlers.py", line 172, in parse
p, suppress_stdout=suppress_stdout, layout_kwargs=layout_kwargs
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\parsers\lattice.py", line 403, in extract_tables
self._generate_image()
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\parsers\lattice.py", line 220, in _generate_image
with Ghostscript(*gs_call, stdout=null) as gs:
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\ext\ghostscript\__init__.py", line 95, in Ghostscript
stderr=kwargs.get("stderr", None),
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\ext\ghostscript\__init__.py", line 39, in __init__
rc = gs.init_with_args(instance, args)
File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\ext\ghostscript\_gsprint.py", line 169, in init_with_args
rc = libgs.gsapi_init_with_args(instance, len(argv), c_argv)

OSError: exception: access violation writing 0x00000080

Process finished with exit code 1

我该如何解决这个问题,或者有其他方法从 PDF 中获取表格吗?

编辑:相同的脚本在 jupyter 笔记本中运行良好,但在 pycharm 中不起作用。

最佳答案

您是否通过 PyPI 存储库安装了 Camelot,即 pip install comelot-py[cv]

从源代码重新安装 Camelot 后,我​​不再收到此错误:

git clone https://www.github.com/camelot-dev/camelot
cd camelot
pip install ".[cv]"

引用文献:

关于python - Camelot python;OSError : exception: access violation writing 0x00000080,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58529975/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com