ERROR: Failed in building wheel for pycairo

Hi,

I’m trying to put my Python project with streamlit on the cloud, but I get this error all the time. I already have the requirements.txt. I’m on Windows 10 operating system.

Building wheel for pycairo (pyproject.toml): started

Building wheel for pycairo (pyproject.toml): finished with status ‘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-39

  creating build/lib.linux-x86_64-cpython-39/cairo

  copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-39/cairo

  copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-39/cairo

  copying cairo/py.typed -> build/lib.linux-x86_64-cpython-39/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

Successfully built cairocffi cufflinks docopt fpdf jax pangocairocffi pangocffi progressbar PyDispatcher svglib validators xhtml2pdf

Failed to build pycairo

ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

I’ve read about this Getting Started — Pycairo documentation 71. But I don’t understand for Windows what packages I have to install

Hi @PARODBE,

Thanks for posting!

Please try adding this to a packages.txt file within your directory based on the pycairo docs:

libcairo2-dev
pkg-config
python3-dev

Thank you for your answer @tonykip . And I have to remover pycairo when I add this packages?

I try yo add these packages in the requirement.txt file, but streamlit was not be able yo find a version…

Can you share a link to your repo so I can better help you troubleshoot?

Sure, it is only a test IS not finish yet, but I was doing tests yesterday.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.