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

problem with reportlab version 4.0.0 #320

Open
sidnou opened this issue May 13, 2023 · 4 comments
Open

problem with reportlab version 4.0.0 #320

sidnou opened this issue May 13, 2023 · 4 comments

Comments

@sidnou
Copy link

sidnou commented May 13, 2023

`Building wheel for pycairo (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for pycairo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/cairo
copying cairo/init.py -> build/lib.linux-x86_64-cpython-310/cairo
copying cairo/init.pyi -> build/lib.linux-x86_64-cpython-310/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-cpython-310/cairo
running build_ext
'pkg-config' not found.
Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
[end of output]

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

@SteinRobert
Copy link

Had the same error in a docker image build.
Adding the following helped:

apt install -y pkg-config

After that cairo was missing. I added the following and everything worked:

 apt install -y libcairo2-dev

Hope it helps.

@peterjc
Copy link

peterjc commented Jun 5, 2023

I've hit this too, also on macOS, as pycairo is a new dependency in ReportLab v4 (having updated from ReportLab v3.6).

It appears that currently only pre-compiled pycairo wheels for Windows are provided on PyPI, and compiling pycairo from source is non-trivial requiring things like the cairo library development headers.

See also #168 looking at providing manylinux wheels which could work for most Linux computers.

@dannielperez
Copy link

Any fixes for these issues? It's been months and pycairo has issues installing in Linux vm's as well.

@stuaxo
Copy link
Collaborator

stuaxo commented Jun 16, 2023

(with help from @naveen521kk's post on the other ticket)
pycairo is a binding to cairo and cairo may be built with different flags under different linux distros, this means that you have to have the dev packages and the headers installed.

If we distributed a pycairo whl then this might not be compatible with the cairo installed in the system.

IMO though: pycairo can't be the only library that has this problem - it applies to any library that is distributed by linux distros where they build with different flags (basically older libraries that use bindings), it would be good to try and work to a general solution with python packaging itself.

The TLDR: is that you have to have the dev packages installed, this was standard for python packages back in the day before WHL etc and pycairo comes from this era.

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

5 participants