I have installed the pyPdf module successfully using the command pip install pydf but when I use the module using the import command I get the following error:
enC:\Anaconda3\lib\site-packages\pyPdf\__init__.py in <module>() 1 from pdf import PdfFileReader, PdfFileWriter 2 __all__ = ["pdf"] ImportError: No module named 'pdf'
What should I do? I have installed the pdf module as well but still the error does not go away.
Use PyPDF2. I've been using it in Python 3 (v3. 5.2 to be precise), and it works quite well. Here's a simple command that you can use to install PyPDF2.
This is a problem of PyPDF, which does not occur in PyPDF2. Actually, the official pyPdf page recommends using PyPDF2.
Install PyPDF2
$ sudo -H pip install PyPDF2
You might need to replace pip
by pip2
or pip3
if you use Python 2 or Python 3.
Use PyPDF2
import PyPDF2
Moving from pyPdf to PyPDF2
Simply replace all occurrences of pyPdf
by PyPDF2
.
Three potential alternatives which are maintained:
pymupdf
: uses mupdf pikepdf
: Uses qpdf pdfminer.six
: A pure Python project. Don't confuse it with the unmaintained pdfminer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With