gpt4 book ai didi

pdfminer - 安装 PDFMiner for Python2.7 时出现错误

转载 作者:行者123 更新时间:2023-12-05 08:58:02 39 4
gpt4 key购买 nike

我按照这里的说明操作:file:///home/bioinfo/Descargas/pdfminer3k-1.3.0/docs/index.html

下载 pdfminer3k-1.3.0 后我做了:

python setup.py install

但是当我这样做的时候

pdf2txt.py samples/simple1.pdf

而且它不读取pdf,路径没问题。它给我返回错误:

>

Traceback (most recent call last):
File "/usr/local/bin/pdf2txt.py", line 5, in <module>
pkg_resources.run_script('pdfminer3k==1.3.0', 'pdf2txt.py')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/EGG-INFO/scripts/pdf2txt.py", line 6, in <module>
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/pdfinterp.py", line 5, in <module>
from .cmapdb import CMapDB, CMap
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/cmapdb.py", line 23, in <module>
from .psparser import PSStackParser
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/psparser.py", line 4, in <module>
from .utils import choplist
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 212, in <module>
0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 180, in <genexpr>
PDFDocEncoding = ''.join( chr(x) for x in (
ValueError: chr() arg not in range(256)

有什么解决办法吗?

最佳答案

最新代码(版本20140328)使用unichr()。试试这个:

pip install pdfminer==20140328

或从https://pypi.python.org/pypi/pdfminer/20140328下载.

关于pdfminer - 安装 PDFMiner for Python2.7 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27390964/

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