Unable to use pypdf module

This is a problem of an old version of pypdf. The history of pypdf is a bit compliated, but the gist of it:

Use pypdf>=3.1.0. All lowercase, no number. Since December 2022, it’s the best supported version.

Install pypdf

$ sudo -H pip install pypdf

You might need to replace pip by pip2 or pip3 if you use Python 2 or Python 3.

Use pypdf

import pypdf

WARNING: PyPDF3 and PyPDF4 are not maintained and PyPDF2 is deprecated – pypdf is the way to go!

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)