无法在Python 3.7中导入“ PyPDF2”

时间:2019-07-18 17:47:28

标签: python python-3.7 pypdf

我想知道,为什么我一生无法导入和使用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

1 个答案:

答案 0 :(得分:0)

您可以执行以下操作:

pip install https://pypi.org/project/PyPDF2/1.23/