using pikepdf in python

1.1k Views Asked by At

After installing pikepdf, while trying code with pikepdf, I am getting error messages as below :

enter image description here

2

There are 2 best solutions below

0
On BEST ANSWER
  1. It's Pdf, not pdf. Use:
from pikepdf import Pdf
  1. Using from pikepdf import ... does not actually import pikepdf itself. Run this to load it:
import pikepdf
  1. It's Pdf.open() not pikepdf.open()

It seems best for you to review the docs for pikepdf.

0
On

You can restart your kernel of your notebook and install pikepdf

!pip install pikepdf

Then you should import it by

from pikepdf import pdf

and so on.

You should install your dependencies first then run the code.