OCRmyPDF
OCRmyPDF copied to clipboard
fatal error: qpdf/Constants.h - pip3 install ocrmypdf and pikepdf on ubuntu win10 subsystem failed
Hi,
there was a thread with the same problem that is closed meanwhile and did not solve my problem. I try to install ocrmypdf on ubuntu LTS 18.04 subsystem for Windows 10 I run into:
src/qpdf/annotation.cpp:11:10: fatal error: qpdf/Constants.h: No such file or directory #include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ compilation terminated.
and subsequent errors.
What can I do?
pip is out of date so it fails to find the current wheel for pikepdf, tries to build from source, and fails again because qpdf headers are not installed.
On Sat., Dec. 7, 2019, 06:58 Michael Hecht, [email protected] wrote:
Hi,
there was a thread with the same problem that is closed meanwhile and did not solve my problem. I try to install ocrmypdf on ubuntu LTS 18.04 subsystem for Windows 10 I run into:
src/qpdf/annotation.cpp:11:10: fatal error: qpdf/Constants.h: No such file or directory #include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ compilation terminated. and subsequent errors.
What can I do?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbarlow83/OCRmyPDF/issues/460?email_source=notifications&email_token=AAN5YM6UKOG3DCVNF4VB6RTQXO227A5CNFSM4JXOCPO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H62PG2Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5YMZ5JVLEDJUWXEL34RTQXO227ANCNFSM4JXOCPOQ .
Pinned because this issue is common.
Try that:
python3 -m pip install --upgrade pip
Then:
python3 -m pip install pikepdf
Thanks @Jeparre I was able to resolve the same issue.
Some users may need to use a different approach than suggested by @Jeparre.
See the pip documentation here: https://pip.pypa.io/en/stable/installing/
I got the same error by run 'pypy3 -m pip install pikepdf', has anyone else encountered this problem
pypy3 is unfortunately not supported by ocrmypdf.
The dependency chain is ocrmypdf -> pikepdf -> pybind11.
This PR has been merged https://github.com/pybind/pybind11/pull/2146 but this is not yet in a tagged version of pybind11.
On Sat., Sep. 26, 2020, 19:24 jie zhang, [email protected] wrote:
I got the same error by run 'pypy3 -m install pikepdf', has anyone else encountered this problem
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbarlow83/OCRmyPDF/issues/460#issuecomment-699574566, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5YM2YEHDUFQUSMX2UATLSH2O4TANCNFSM4JXOCPOQ .
I am Japanese. I am sorry for my poor writing.
I ran into the same problem trying to install img2pdf on CentOS Python 3.6. I tried the method shown by @Jeparre but couldn't do it. Also, I couldn't find it in the pip documentation.
I'm sorry for your busy schedule, but I would appreciate it if you could help me out.
@kaitosea916 If you have CentOS and Python 3.6, it looks like you have CentOS 7. CentOS 7 was released in 2014, making it older than the earliest version of OCRmyPDF. You would have to compile about a dozen pieces of software from source to get current versions of all of OCRmyPDF's dependencies working; it would take many many hours of work.
Your best bet is to use Docker container to run the latest version.
@jbarlow83 Thank you for your answer, and I'm very sorry I forgot to fill in the CentOS version.I am using CentOS 8.In that case, would it be possible to take the method you described?
Easier but still a lot of hassle.
Is there a reason you can't use Docker?
On Thu., Oct. 1, 2020, 04:20 kaitosea916, [email protected] wrote:
@jbarlow83 https://github.com/jbarlow83 Thank you for your answer, and I'm very sorry I forgot to fill in the CentOS version.I am using CentOS 8.In that case, would it be possible to take the method you described?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jbarlow83/OCRmyPDF/issues/460#issuecomment-702067182, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5YM5PYQSACU5XLJYFURLSIRQZNANCNFSM4JXOCPOQ .
There's no reason why you can't use Docker. I will try your method once. Thank you for your help.
I'm having similiar problem with win10. I have reinstalled newest software and lib versions (python, visual studio, pip and advised libraries via choco and pip) even qpdf is already installed. I'm still having fatal error:
src/qpdf\annotation.cpp(11): fatal error C1083: Cannot open include file:
any advices?
Full pip install transcribe:
PS C:\WINDOWS\system32> pip install ocrmypdf
Collecting ocrmypdf
Using cached ocrmypdf-11.2.1-py35-none-any.whl (125 kB)
Collecting coloredlogs>=14.0
Using cached coloredlogs-14.0-py2.py3-none-any.whl (43 kB)
Collecting pluggy>=0.13.0
Using cached pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
Collecting tqdm>=4
Using cached tqdm-4.50.2-py2.py3-none-any.whl (70 kB)
Collecting reportlab>=3.3.0
Using cached reportlab-3.5.53.tar.gz (2.9 MB)
Collecting img2pdf<0.5,>=0.3.0
Using cached img2pdf-0.4.0.tar.gz (107 kB)
Collecting pikepdf<2,>=1.14.0
Using cached pikepdf-1.19.3.tar.gz (2.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting Pillow>=7.0.0
Using cached Pillow-8.0.0-cp39-cp39-win_amd64.whl (2.1 MB)
Requirement already satisfied: cffi>=1.9.1 in c:\python39\lib\site-packages (from ocrmypdf) (1.14.3)
Collecting pdfminer.six!=20200720,<=20200726,>=20191110
Using cached pdfminer.six-20200726-py3-none-any.whl (5.6 MB)
Collecting humanfriendly>=7.1
Using cached humanfriendly-8.2-py2.py3-none-any.whl (86 kB)
Collecting lxml>=4.0
Using cached lxml-4.5.2.tar.gz (4.5 MB)
Requirement already satisfied: pycparser in c:\python39\lib\site-packages (from cffi>=1.9.1->ocrmypdf) (2.20)
Requirement already satisfied: chardet; python_version > "3.0" in c:\python39\lib\site-packages (from pdfminer.six!=20200720,<=20200726,>=20191110->ocrmypdf) (3.0.4)
Collecting sortedcontainers
Using cached sortedcontainers-2.2.2-py2.py3-none-any.whl (29 kB)
Collecting cryptography
Using cached cryptography-3.1.1-cp36-abi3-win_amd64.whl (1.5 MB)
Collecting pyreadline; sys_platform == "win32"
Using cached pyreadline-2.1.zip (109 kB)
Requirement already satisfied: six>=1.4.1 in c:\python39\lib\site-packages (from cryptography->pdfminer.six!=20200720,<=20200726,>=20191110->ocrmypdf) (1.15.0)
Using legacy 'setup.py install' for reportlab, since package 'wheel' is not installed.
Using legacy 'setup.py install' for img2pdf, since package 'wheel' is not installed.
Using legacy 'setup.py install' for lxml, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyreadline, since package 'wheel' is not installed.
Building wheels for collected packages: pikepdf
Building wheel for pikepdf (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python39\python.exe' 'c:\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\xxx\AppData\Local\Temp\tmpsrv5ulo6'
cwd: C:\Users\xxx\AppData\Local\Temp\pip-install-c6wvuy8z\pikepdf
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\codec.py -> build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\jbig2.py -> build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\objects.py -> build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\_cpphelpers.py -> build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\_methods.py -> build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\_version.py -> build\lib.win-amd64-3.9\pikepdf
copying src\pikepdf\__init__.py -> build\lib.win-amd64-3.9\pikepdf
creating build\lib.win-amd64-3.9\pikepdf\models
copying src\pikepdf\models\encryption.py -> build\lib.win-amd64-3.9\pikepdf\models
copying src\pikepdf\models\image.py -> build\lib.win-amd64-3.9\pikepdf\models
copying src\pikepdf\models\matrix.py -> build\lib.win-amd64-3.9\pikepdf\models
copying src\pikepdf\models\metadata.py -> build\lib.win-amd64-3.9\pikepdf\models
copying src\pikepdf\models\outlines.py -> build\lib.win-amd64-3.9\pikepdf\models
copying src\pikepdf\models\__init__.py -> build\lib.win-amd64-3.9\pikepdf\models
running build_ext
building 'pikepdf._qpdf' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\qpdf
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVERSION_INFO="1.19.3" -IC:\Users\xxx\AppData\Local\Temp\pip-build-env-9costd4v\overlay\Lib\site-packages\pybind11\include -Ic:\python39\include -Ic:\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tpsrc/qpdf\annotation.cpp /Fobuild\temp.win-amd64-3.9\Release\src/qpdf\annotation.obj /EHsc
annotation.cpp
src/qpdf\annotation.cpp(11): 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\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pikepdf
Failed to build pikepdf
**ERROR: Could not build wheels for pikepdf which use PEP 517 and cannot be installed direct**ly
This comment is no longer current.
Python 3.9 is quite new and most packages do not have binary wheels available, so it's trying to build everything from source. Bit of a nightmare on Windows. This problem is just the first hurdle. It will also try to build these from source and any of their dependencies:
Using legacy 'setup.py install' for reportlab, since package 'wheel' is not installed.
Using legacy 'setup.py install' for lxml, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyreadline, since package 'wheel' is not installed.
Wait a month or so for all the Python libraries to catch up to 3.9. Use 3.8 for now.
Regardless of what Python you're using, make sure you update pip and wheel to the latest version to avoid other frustrations.
@brje pikepdf 2.0.0b1 and Python 3.9 should work now. You'd have to force pip to install pikepdf 2.0.0b1 since it's a beta.
pikepdf 2.0.0 and 2.1.0 are now out
I found this on Reddit. Solved my issue.
The compilation cannot succeed because it relies on your system having a particular library and the source code (or at least the description of the library's interface), which is the header files it's missing.
Probably, something like apt-get install libqpdf-dev
will solve your problem.
For Arch Linux, installing qpdf
should be enough.
I'm facing this problem and haven't been able to overcome it.
I tried to overcome it by downloading qpdf-11.1.1.tar.gz. I took the "include\qpdf" directory and placed in the python include directory.
It now compiles, but just fails in the LINK process. As soon as I can reach the machine where I'm trying to install again, I'll copy de exact error message.
Any help would be greatly appreciated
(Using Windows 10)
@elysch If you're using Python 3.11, the lxml library has not released binary wheels for Windows yet, so I can't release pikepdf binary wheels. pikepdf should be installl to all other versions of Python on Windows without compiling.
The other exception would be if you're using Windows+ARM.
@jbarlow83 I got the same problem. I'm on an Apple Silicon mac. The exact error is this:
error: subprocess-exited-with-error
× Building wheel for pikepdf (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [94 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-arm64-cpython-38
creating build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/_methods.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/_version.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/_cpphelpers.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/jbig2.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/_xml.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/settings.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/objects.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/codec.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/_exceptions.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/_augments.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
creating build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/matrix.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/_transcoding.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/encryption.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/metadata.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/_content_stream.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/outlines.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
copying src/pikepdf/models/image.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models
running egg_info
writing src/pikepdf.egg-info/PKG-INFO
writing dependency_links to src/pikepdf.egg-info/dependency_links.txt
writing requirements to src/pikepdf.egg-info/requires.txt
writing top-level names to src/pikepdf.egg-info/top_level.txt
/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/setuptools_scm/git.py:284: UserWarning: git archive did not support describe output
warnings.warn("git archive did not support describe output")
/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/setuptools_scm/git.py:301: UserWarning: unexported git archival found
warnings.warn("unexported git archival found")
listing git files failed - pretending there aren't any
reading manifest file 'src/pikepdf.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
adding license file 'licenses-for-wheels.txt'
writing manifest file 'src/pikepdf.egg-info/SOURCES.txt'
copying src/pikepdf/_qpdf.pyi -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
copying src/pikepdf/py.typed -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf
running build_ext
building 'pikepdf._qpdf' extension
creating build/temp.macosx-10.14-arm64-cpython-38
creating build/temp.macosx-10.14-arm64-cpython-38/src
creating build/temp.macosx-10.14-arm64-cpython-38/src/qpdf
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/annotation.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/annotation.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/embeddedfiles.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/embeddedfiles.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/logger.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/logger.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/job.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/job.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/nametree.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/nametree.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/numbertree.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/numbertree.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/object.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/object.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/object_convert.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/object_convert.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
src/qpdf/numbertree.cpp:4:10: src/qpdf/embeddedfiles.cpp:4:10: fatal error: 'qpdf/Constants.h' file not found
src/qpdf/nametree.cpp:4:10: fatal error: 'qpdf/Constants.h' file not found
src/qpdf/annotation.cpp:4:10: fatal error: 'qpdf/Constants.h' file not found
fatal error: 'qpdf/Constants.h' file not found
#include <qpdf/Constants.h>
^~~~~~~~~~~~~~~~~~
#include <qpdf/Constants.h>#include <qpdf/Constants.h>#include <qpdf/Constants.h>
^~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~
^~~~~~~~~~~~~~~~~~
src/qpdf/object.cpp:7:10: fatal error: 'qpdf/Constants.h' file not found
#include <qpdf/Constants.h>
^~~~~~~~~~~~~~~~~~
In file included from src/qpdf/logger.cpp:4:
src/qpdf/pikepdf.h:10:10: fatal error: 'qpdf/QPDF.hh' file not found
#include <qpdf/QPDF.hh>
^~~~~~~~~~~~~~
src/qpdf/object_convert.cpp:12:10: fatal error: 'qpdf/Constants.h' file not found
#include <qpdf/Constants.h>
^~~~~~~~~~~~~~~~~~
src/qpdf/job.cpp:6:10: fatal error: 'qpdf/QPDFJob.hh' file not found
#include <qpdf/QPDFJob.hh>
^~~~~~~~~~~~~~~~~
1 error generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/object_repr.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/object_repr.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14
error: command '/usr/bin/clang' failed with exit code 1
1 error generated.
1 error generated.
1 error generated.
1 error generated.
1 error generated.
1 error generated.
1 error generated.
src/qpdf/object_repr.cpp:19:10: fatal error: 'qpdf/Constants.h' file not found
#include <qpdf/Constants.h>
^~~~~~~~~~~~~~~~~~
1 error generated.```
@jbarlow83我遇到了同样的问题。我在 Apple Silicon Mac 上。 确切的错误是这样的:
error: subprocess-exited-with-error × Building wheel for pikepdf (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [94 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.14-arm64-cpython-38 creating build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/_methods.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/_version.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/_cpphelpers.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/jbig2.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/_xml.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/settings.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/objects.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/codec.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/_exceptions.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/_augments.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf creating build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/matrix.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/_transcoding.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/encryption.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/metadata.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/_content_stream.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/outlines.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models copying src/pikepdf/models/image.py -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf/models running egg_info writing src/pikepdf.egg-info/PKG-INFO writing dependency_links to src/pikepdf.egg-info/dependency_links.txt writing requirements to src/pikepdf.egg-info/requires.txt writing top-level names to src/pikepdf.egg-info/top_level.txt /private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/setuptools_scm/git.py:284: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/setuptools_scm/git.py:301: UserWarning: unexported git archival found warnings.warn("unexported git archival found") listing git files failed - pretending there aren't any reading manifest file 'src/pikepdf.egg-info/SOURCES.txt' adding license file 'LICENSE.txt' adding license file 'licenses-for-wheels.txt' writing manifest file 'src/pikepdf.egg-info/SOURCES.txt' copying src/pikepdf/_qpdf.pyi -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf copying src/pikepdf/py.typed -> build/lib.macosx-10.14-arm64-cpython-38/pikepdf running build_ext building 'pikepdf._qpdf' extension creating build/temp.macosx-10.14-arm64-cpython-38 creating build/temp.macosx-10.14-arm64-cpython-38/src creating build/temp.macosx-10.14-arm64-cpython-38/src/qpdf clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/annotation.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/annotation.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/embeddedfiles.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/embeddedfiles.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/logger.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/logger.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/job.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/job.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/nametree.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/nametree.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/numbertree.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/numbertree.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/object.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/object.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/object_convert.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/object_convert.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 src/qpdf/numbertree.cpp:4:10: src/qpdf/embeddedfiles.cpp:4:10: fatal error: 'qpdf/Constants.h' file not found src/qpdf/nametree.cpp:4:10: fatal error: 'qpdf/Constants.h' file not found src/qpdf/annotation.cpp:4:10: fatal error: 'qpdf/Constants.h' file not found fatal error: 'qpdf/Constants.h' file not found #include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ #include <qpdf/Constants.h>#include <qpdf/Constants.h>#include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~ src/qpdf/object.cpp:7:10: fatal error: 'qpdf/Constants.h' file not found #include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ In file included from src/qpdf/logger.cpp:4: src/qpdf/pikepdf.h:10:10: fatal error: 'qpdf/QPDF.hh' file not found #include <qpdf/QPDF.hh> ^~~~~~~~~~~~~~ src/qpdf/object_convert.cpp:12:10: fatal error: 'qpdf/Constants.h' file not found #include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ src/qpdf/job.cpp:6:10: fatal error: 'qpdf/QPDFJob.hh' file not found #include <qpdf/QPDFJob.hh> ^~~~~~~~~~~~~~~~~ 1 error generated. clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DPOINTERHOLDER_TRANSITION=4 -I/private/var/folders/d2/3fxk2q7541q8yvbjfn2dkcj00000gn/T/pip-build-env-gs2t15dp/overlay/lib/python3.8/site-packages/pybind11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c src/qpdf/object_repr.cpp -o build/temp.macosx-10.14-arm64-cpython-38/src/qpdf/object_repr.o -fvisibility=hidden -g0 -stdlib=libc++ -std=c++17 -mmacosx-version-min=10.14 error: command '/usr/bin/clang' failed with exit code 1 1 error generated. 1 error generated. 1 error generated. 1 error generated. 1 error generated. 1 error generated. 1 error generated. src/qpdf/object_repr.cpp:19:10: fatal error: 'qpdf/Constants.h' file not found #include <qpdf/Constants.h> ^~~~~~~~~~~~~~~~~~ 1 error generated.```
In fact, all of the above are in vain.
What's really missing is the lxml package, which requires installing so many dependencies to build it, since it doesn't have a buildpack for the version of Python you're using.
In fact, all you have to do is go to this site
https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
Select your corresponding Python version in this website, then download the corresponding built lxml package, and you can install it normally.
The installation command is:
pip install xx.whl
After installing lxml, you will find that you can install pikepdf normally
其实这上面做的这些都是徒劳的。
真正缺少的是 lxml 这个软件包,因为它没有您使用的 Python 的版本的构建包,所以才需要安装如此多的依赖去构建它。
事实上,您只需要去这个网站
https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
在这个网站内选择您对应的 Python 版本,然后下载对应的构建好了的 lxml 程序包,就可以正常安装它了。
安装命令是:
pip install xx.whl
安装完 lxml 以后,你就会发现你可以正常安装 pikepdf 了。
我正面临这个问题,但一直无法克服。
我试图通过下载qpdf-11.1.1.tar.gz来克服它。我把“include\qpdf”目录放到了python的include目录下。
它现在可以编译,但只是在 LINK 过程中失败。 一旦我到达我尝试再次安装的机器,我将复制确切的错误消息。
任何帮助将不胜感激
(使用 Windows 10)
If you didn't solve this problem, you can try my solution
如果您没有解决这个问题的话,可以试试我的解决方案
@elysch If you're using Python 3.11, the lxml library has not released binary wheels for Windows yet, so I can't release pikepdf binary wheels. pikepdf should be installl to all other versions of Python on Windows without compiling.
The other exception would be if you're using Windows+ARM.
@jbarlow83 Has the lxml library been updated for Python 3.11.1 as I'm unable to get pikepdf to install with that version of Python on Windows Server 2019. It had worked fine on Python 3.9.6 on the same machine but upgrading Python to see if it resolves another issue.
python -m pip install pikepdf
Collecting pikepdf
Using cached pikepdf-6.2.6.tar.gz (2.9 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting Pillow>=9.0
Using cached Pillow-9.3.0-cp311-cp311-win32.whl (2.2 MB)
Collecting deprecation
Using cached deprecation-2.1.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: lxml>=4.8 in c:\python311-32\lib\site-packages (from pikepdf) (4.9.2)
Requirement already satisfied: packaging in c:\python311-32\lib\site-packages (from pikepdf) (22.0)
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
╰─> [52 lines of output]
C:\Users\MMEadmin\AppData\Local\Temp\2\pip-build-env-f01r4mhj\overlay\Lib\site-packages\setuptools_scm\git.py:295: UserWarning: git archive did not support describe output
warnings.warn("git archive did not support describe output")
C:\Users\MMEadmin\AppData\Local\Temp\2\pip-build-env-f01r4mhj\overlay\Lib\site-packages\setuptools_scm\git.py:312: UserWarning: unexported git archival found
warnings.warn("unexported git archival found")
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-cpython-311
creating build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\codec.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\jbig2.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\objects.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\settings.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\_augments.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\_cpphelpers.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\_exceptions.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\_methods.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\_version.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\_xml.py -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\__init__.py -> build\lib.win32-cpython-311\pikepdf
creating build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\encryption.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\image.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\matrix.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\metadata.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\outlines.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\_content_stream.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\_transcoding.py -> build\lib.win32-cpython-311\pikepdf\models
copying src\pikepdf\models\__init__.py -> build\lib.win32-cpython-311\pikepdf\models
running egg_info
writing src\pikepdf.egg-info\PKG-INFO
writing dependency_links to src\pikepdf.egg-info\dependency_links.txt
writing requirements to src\pikepdf.egg-info\requires.txt
writing top-level names to src\pikepdf.egg-info\top_level.txt
listing git files failed - pretending there aren't any
reading manifest file 'src\pikepdf.egg-info\SOURCES.txt'
adding license file 'LICENSE.txt'
adding license file 'licenses-for-wheels.txt'
writing manifest file 'src\pikepdf.egg-info\SOURCES.txt'
copying src\pikepdf\_qpdf.pyi -> build\lib.win32-cpython-311\pikepdf
copying src\pikepdf\py.typed -> build\lib.win32-cpython-311\pikepdf
running build_ext
building 'pikepdf._qpdf' extension
creating build\temp.win32-cpython-311
creating build\temp.win32-cpython-311\Release
creating build\temp.win32-cpython-311\Release\src
creating build\temp.win32-cpython-311\Release\src\qpdf
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPOINTERHOLDER_TRANSITION=4 -IC:\Users\MMEadmin\AppData\Local\Temp\2\pip-build-env-f01r4mhj\overlay\Lib\site-packages\pybind11\include -IC:\Python311-32\include -IC:\Python311-32\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /EHsc /Tpsrc/qpdf\annotation.cpp /Fobuild\temp.win32-cpython-311\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\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x86\\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
Ended up here because of build problems on my Mac. Fixed it by installing qpdf manually with brew. https://ports.macports.org/port/qpdf/
@frahlg your solution worked for me (brew install qpdf
), thank you!
I was having the same situation (problems with Mac M1 chip)
For me installing ocrmypdf manually with brew and then doing a pip install worked with the same issue, not a perfect solution though, since my pip and python comes from pyenv and I am not using the brew python so I would have loved to not have to do the brew install step.
I am also on m1 pro, so I guess there are just no pre compiled arm sources for qpdf in the pip repo?