4

I am trying to install the pikepdf package although, I am receiving the below error when I run: import pikepdf.

What do I need to fix in order to have pikepdf import correctly?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/anaconda/lib/python3.6/site-packages/pikepdf/__init__.py in <module>()
     14 try:
---> 15     from . import _qpdf
     16 except ImportError as _e:

ImportError: dlopen(/anaconda/lib/python3.6/site-packages/pikepdf/_qpdf.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libjpeg.9.dylib
  Referenced from: /anaconda/lib/libqpdf.28.dylib
  Reason: Incompatible library version: libqpdf.28.dylib requires version 13.0.0 or later, but libjpeg.9.dylib provides version 12.0.0

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
<ipython-input-203-f1a5a828eb8c> in <module>()
----> 1 import pikepdf
      2 
      3 # pdf = pikepdf.open('unextractable.pdf')
      4 # pdf.save('extractable.pdf')

/anaconda/lib/python3.6/site-packages/pikepdf/__init__.py in <module>()
     21             "Redistributable (x64) 14.24.28127 or newer."
     22         )
---> 23     raise ImportError(msg) from _e
     24 
     25 try:

ImportError: pikepdf's extension library failed to import
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
santorch
  • 151
  • 1
  • 14
  • Do you have pikepdf on your machine? `pip install pikepdf ` try this if didn't installed it yet. – Yagiz Degirmenci Apr 20 '20 at 01:48
  • 1
    yes I have it installed. pikepdf 1.11.0 py36h0130604_0 conda-forge – santorch Apr 20 '20 at 01:50
  • 1
    @santorch the problem seems to exist up to today. In most of the cases that seems due to too new version of Python, at least that's what I am facing. You either have to use an older ver of python (like Python3.x-1) or fix some issues manyally in files – Anna-Lischen Sep 10 '21 at 10:19

0 Answers0