-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fatal error: qpdf/Constants.h - pip3 install ocrmypdf and pikepdf on ubuntu win10 subsystem failed #460
Comments
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, ***@***.***> 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
<#460>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN5YMZ5JVLEDJUWXEL34RTQXO227ANCNFSM4JXOCPOQ>
.
|
Pinned because this issue is common. |
Try that: Then: |
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: |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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 |
For Arch Linux, installing |
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. 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. 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:
After installing lxml, you will find that you can install pikepdf normally 其实这上面做的这些都是徒劳的。 真正缺少的是 lxml 这个软件包,因为它没有您使用的 Python 的版本的构建包,所以才需要安装如此多的依赖去构建它。 事实上,您只需要去这个网站 https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 在这个网站内选择您对应的 Python 版本,然后下载对应的构建好了的 lxml 程序包,就可以正常安装它了。 安装命令是:
安装完 lxml 以后,你就会发现你可以正常安装 pikepdf 了。 |
If you didn't solve this problem, you can try my solution 如果您没有解决这个问题的话,可以试试我的解决方案 |
@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.
|
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 ( 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? |
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?
The text was updated successfully, but these errors were encountered: