简体   繁体   中英

Unable to import PyPDF2 after installing

I have installed PyPDF2 via pip3 install PyPDF2. The installation was successful. I am trying to import into Python unsuccessfully, and I do not know what is going on! I am using Python 3.7

After entering: from PyPDF2 import PdfFileReader

The following is what happens:

Traceback (most recent call last):

File " < stdin >", line 1, in < module >

ModuleNotFoundError: No module named 'PyPDF2'

I am wondering maybe the PyPDF2 was installed in the wrong folder. The current folder it is in: ..\\LocalCache\\local-packages\\Python37\\site-packages

try installing by:

python3.7 -m pip install PyPDF2
python3.7
>>> import PyPDF2

To install this on windows using python 3.7 you must:

  1. install the tar.gz file from the PyPDF website
  2. then navivate to the file,
  3. type cmd in the path bar.
  4. from there you will enter setup.py.

After that enter pip install PyPDF2 and ta-da.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM