2013-10-04 54 views
0

了pyPDF2 LIB跑這裏例如: https://github.com/mstamy2/PyPDF2/tree/Python3-3pyPDF2類型錯誤時,從LIB從

當試圖運行腳本「示例1:」從那裏看到:

PyPDF2 python versions (2.5 - 3.3) compatibility branch 

Traceback (most recent call last): 

    File "1.py", line 6, in <module> 
    input1 = PdfFileReader(open("document1.pdf", "rb")) 
    File "C:\Python33\lib\site-packages\PyPDF2\pdf.py", line 595, in __init__ 
    self.read(stream) 
    File "C:\Python33\lib\site-packages\PyPDF2\pdf.py", line 1097, in read 
    streamData = StringIO(xrefstream.getData()) 
TypeError: initial_value must be str or None, not bytes 

什麼是錯的?

+0

你終於找到解決這個錯誤的辦法了嗎? – juankysmith

+0

不,我找不到解決方案( – Dmitry

+0

嘗試提取文本時可能出現[pyPDF2 TypeError]重複(http://stackoverflow.com/questions/17270387/pypdf2-typeerror-when-trying-to-extract-text ) – juankysmith

回答

0

它涉及到內PyPDF2和Python 3

在我的情況的兼容性問題,我已經與那些你會發現,這裏更換pdf.py和utils.py,他們基本上解決了它控制你是否運行Python 3,如果你是,接收數據作爲字節而不是字符串。

相關問題