pdfminer3k安装显示成功,但是运行pdf2test.py失败了

来源:5-3 验证pdfminer3k是否安装成功

mmm拇

2016-10-16 18:25

pdfminer3k的安装应该是没问题的,最后显示的跟老师视频上一样的:

Finished processing dependencies for pdfminer3k==1.3.1


但是按照后来验证的操作,尝试了几次还是报错。

我的是2.7  然后是 mac OS ,是因为版本问题吗?求解答,谢谢!!

报错内容:

Traceback (most recent call last):

  File "pdf2txt.py", line 6, in <module>

    from pdfminer.pdfinterp import PDFResourceManager, process_pdf

  File "/Library/Python/2.7/site-packages/pdfminer3k-1.3.1-py2.7.egg/pdfminer/pdfinterp.py", line 5, in <module>

    from .cmapdb import CMapDB, CMap

  File "/Library/Python/2.7/site-packages/pdfminer3k-1.3.1-py2.7.egg/pdfminer/cmapdb.py", line 23, in <module>

    from .psparser import PSStackParser

  File "/Library/Python/2.7/site-packages/pdfminer3k-1.3.1-py2.7.egg/pdfminer/psparser.py", line 4, in <module>

    from .utils import choplist

  File "/Library/Python/2.7/site-packages/pdfminer3k-1.3.1-py2.7.egg/pdfminer/utils.py", line 212, in <module>

    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,

  File "/Library/Python/2.7/site-packages/pdfminer3k-1.3.1-py2.7.egg/pdfminer/utils.py", line 180, in <genexpr>

    PDFDocEncoding = ''.join( chr(x) for x in (

ValueError: chr() arg not in range(256)


写回答 关注

2回答

  • 流年虚写繁华尽碎
    2018-02-23 14:57:36

    我的win10和你的情况一样

  • 慕粉1123033288
    2016-10-16 22:44:54

    应该是版本问题,2.7和3之后的版本在某些包的导入上都有区别

python遇见数据采集

本教程让你初步掌握Python进行数据采集,创造属于你的价值

59669 学习 · 200 问题

查看课程

相似问题