我想知道,为什么我一生无法导入和使用Python 3.7中的PyPDF2
(PDF库)。
首先,我的导入操作在main.py
(即下面)的顶部失败
from PyPDF2 import PdfFileReader
然后我尝试了pip install PyPDF2
和变体形式pip2 install PyPDF3
等。
所有均导致以下输出:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)'))': /simple/pypdf2/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)'))': /simple/pypdf2/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)'))': /simple/pypdf2/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)'))': /simple/pypdf2/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)'))': /simple/pypdf2/
Could not find a version that satisfies the requirement PyPDF2 (from versions: )
No matching distribution found for PyPDF2
答案 0 :(得分:0)
您可以执行以下操作:
pip install https://pypi.org/project/PyPDF2/1.23/