11

When trying to install the python moduel pikepdf using pip, this error pops up:

Building wheels for collected packages: pikepdf
  Building wheel for pikepdf (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pikepdf (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      ...
      creating build\temp.win-amd64-cpython-310\Release\src\qpdf
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPOINTERHOLDER_TRANSITION=4 -IC:\Users\ME\AppData\Local\Temp\pip-build-env-dpc9ltd5\overlay\Lib\site-packages\pybind11\include "-IC:\Program Files\Python310\include" "-IC:\Program Files\Python310\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc/qpdf\annotation.cpp /Fobuild\temp.win-amd64-cpython-310\Release\src/qpdf\annotation.obj /EHsc /bigobj /std:c++17
      annotation.cpp
      src/qpdf\annotation.cpp(4): fatal error C1083: Cannot open include file: 'qpdf/Constants.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pikepdf
Failed to build pikepdf
ERROR: Could not build wheels for pikepdf, which is required to install pyproject.toml-based projects

Creating the wheel fails due to a missing header file:

src/qpdf\annotation.cpp(4): fatal error C1083: Cannot open include file: 'qpdf/Constants.h': No such file or directory

This is for pikepdf v6.0.0. My previous version was v4.0.1.post1, which worked fine.

Is this something that can be remedied from my side?

parvus
  • 5,706
  • 6
  • 36
  • 62
duke
  • 111
  • 1
  • 3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 23 '21 at 13:25

3 Answers3

13

Solution for Macbook, M1

brew install qpdf

After it use

pip install pikepdf

Solution from https://github.com/pikepdf/pikepdf/issues/274

tencet
  • 382
  • 5
  • 18
0

Just list all versions available for pidepdf:

pip index versions pikepdf

Pick one and install it:

pip install pikepdf==5.6.1

Check back in a later version whether this is resolved. Issues like these can be reported in their tracker: https://github.com/pikepdf/pikepdf/issues

The problem listed is known. From https://github.com/pikepdf/pikepdf/issues/390:

pikepdf 6 requires qpdf 11 and drops compatibility for all earlier versions. [...] Binary wheel status: Windows support is currently blocked by [...]

parvus
  • 5,706
  • 6
  • 36
  • 62
-1

I had to upgrade the pip package and then run

pip install --upgrade pip

pip3 install pikepdf
SuperNova
  • 25,512
  • 7
  • 93
  • 64