Skip to content
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

Unable to install pymupdf 1.25.x using poetry #4339

Open
sahas-si opened this issue Feb 27, 2025 · 4 comments
Open

Unable to install pymupdf 1.25.x using poetry #4339

sahas-si opened this issue Feb 27, 2025 · 4 comments

Comments

@sahas-si
Copy link

Description of the bug

Earlier our server(EC2 Docker python-3.11.9-slim) was running on pymupdf 1.24.0. While upgrading to 1.25.3 using poetry in docker instance, got the below errors.

[stderr]#13 25.07
[stderr]#13 25.07 - not supporting PEP 517 builds
[stderr]#13 25.07 - not specifying PEP 517 build requirements correctly
[stderr]#13 25.07 - the build requirements are incompatible with your operating system or Python version
[stderr]#13 25.07 - the build requirements are missing system dependencies (eg: compilers, libraries, headers).
[stderr]#13 25.07
[stderr]#13 25.07 You can verify this by running pip wheel --no-cache-dir --use-pep517 "pymupdf (==1.25.3)".
[stderr]#13 25.07
[stderr]#13 ERROR: process "/bin/sh -c poetry config virtualenvs.create false && poetry install --no-root --only main" did not complete successfully: exit code: 1
[stderr]------
[stderr] > [8/8] RUN poetry config virtualenvs.create false && poetry install --no-root --only main:
[stderr]25.07
[stderr]25.07 Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with pymupdf (1.25.3)
[stderr]25.07
[stderr]25.07 - not supporting PEP 517 builds
[stderr]25.07 - not specifying PEP 517 build requirements correctly
[stderr]25.07 - the build requirements are incompatible with your operating system or Python version
[stderr]25.07 - the build requirements are missing system dependencies (eg: compilers, libraries, headers).
[stderr]25.07
[stderr]25.07 You can verify this by running pip wheel --no-cache-dir --use-pep517 "pymupdf (==1.25.3)".
[stderr]25.07

How to reproduce the bug

  1. Create a dockerfile which installs dependencies via poetry
  2. Add pymupdf with version 1.25.3
  3. Start the docker instance

PyMuPDF version

1.25.3

Operating system

Linux

Python version

3.11

@julian-smith-artifex-com
Copy link
Collaborator

Thanks for the report.

What CPU are you on, e.g. x86_64 or aarch64?

@sahas-si
Copy link
Author

sahas-si commented Feb 27, 2025 via email

@julian-smith-artifex-com
Copy link
Collaborator

Ah, there was a problem on Github's Linux-aarch64's runner when building Linux-aarch64 wheels, so they are not available in the current release.

I suspect that poetry is attempting to build PyMuPDF source, which it hasn't had to do before for you, and something is going wrong with the build.

A workaround would be to install PyMuPDF-1.25.2, for which Linux-aarch64 wheels are available.

[PyMuPDF's setup.py does support PEP 517 and works fine with pip or cibuildwheel, but it's possible it's not supporting something required by pip --use-pep517; i'm looking into this.]

@julian-smith-artifex-com
Copy link
Collaborator

Pip can build PyMuPDF from source with no problems with the command suggested by poetry (plus --no-binary pymupdf to force build from source):

pip wheel --use-pep517 --no-binary pymupdf "pymupdf (==1.25.3)" -vv --no-cache-dir

So this looks like a problem with Poetry itself, not PyMuPDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants