本文介绍了无法在Python 3.7中导入"PyPDF2"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道,为什么我一生无法导入和使用Python 3.7中的PyPDF2
(PDF库).
I am wondering, why, for the life of me I cannot import and use PyPDF2
(PDF library) in Python 3.7.
首先,我的导入操作在main.py
(即下面)的顶部失败
Firstly, my import fails at top of main.py
(i.e. below)
from PyPDF2 import PdfFileReader
然后我尝试了pip install PyPDF2
和变体pip2 install PyPDF3
等,等等.
Then I have tried pip install PyPDF2
and variants pip2 install PyPDF3
etc etc.
所有均导致以下输出:
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
推荐答案
您可以执行以下操作:
pip install https://pypi.org/project/PyPDF2/1.23/
这篇关于无法在Python 3.7中导入"PyPDF2"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!