pygobject/pycairo

Failed to install in github codespace

Opened this issue · 2 comments

tyeth commented

Hey, the docs offer install strings for most platforms, but that fails in github codespace https://github.com/tyeth/boxes
After a bit chatting with bard and trying alternatives (apt [libcairo2-dev not found] pip3 --force upgrade etc), it eventually suggested conda, which appeared to work flawlessly.

Suggestion to add conda install pycairo to list of alternative package manager install commands.

tyeth commented

Tell a lie, still doesn't work. Curious, here's the log output: [I'd installed pycairo via conda at this point, but not activated env until second log]

Original pip install Details


(base) @tyeth ➜ /workspaces/boxes (snapmaker2-A350-airpurifier) $ pip3 install -r requirements_dev.txt 
Collecting inkex (from -r requirements_dev.txt (line 1))
  Using cached inkex-1.3.0-py3-none-any.whl.metadata (3.0 kB)
Collecting mypy (from -r requirements_dev.txt (line 2))
  Downloading mypy-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.8 kB)
Collecting pre-commit (from -r requirements_dev.txt (line 3))
  Using cached pre_commit-3.6.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting types-Markdown (from -r requirements_dev.txt (line 4))
  Using cached types_Markdown-3.5.0.20240129-py3-none-any.whl.metadata (1.8 kB)
Collecting Pillow>=7.0.0 (from inkex->-r requirements_dev.txt (line 1))
  Downloading pillow-10.2.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (9.7 kB)
Collecting PyGObject>=3.36 (from inkex->-r requirements_dev.txt (line 1))
  Using cached PyGObject-3.46.0.tar.gz (723 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      Collecting setuptools
        Using cached setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
      Collecting wheel
        Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting pycairo
        Using cached pycairo-1.25.1.tar.gz (347 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Using cached setuptools-69.0.3-py3-none-any.whl (819 kB)
      Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
      Building wheels for collected packages: pycairo
        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
        ╰─> [15 lines of output]
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.linux-x86_64-cpython-311
            creating build/lib.linux-x86_64-cpython-311/cairo
            copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-311/cairo
            copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-311/cairo
            copying cairo/py.typed -> build/lib.linux-x86_64-cpython-311/cairo
            running build_ext
            Package cairo was not found in the pkg-config search path.
            Perhaps you should add the directory containing `cairo.pc'
            to the PKG_CONFIG_PATH environment variable
            No package 'cairo' found
            Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
            [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
      
      [notice] A new release of pip is available: 23.3.2 -> 24.0
      [notice] To update, run: pip install --upgrade pip
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 23.3.2 -> 24.0
[notice] To update, run: pip install --upgrade pip

conda environment pip output

Collecting PyGObject>=3.36 (from inkex->-r requirements_dev.txt (line 1))
  Using cached PyGObject-3.46.0.tar.gz (723 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      Collecting setuptools
        Using cached setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
      Collecting wheel
        Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting pycairo
        Using cached pycairo-1.25.1.tar.gz (347 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Using cached setuptools-69.0.3-py3-none-any.whl (819 kB)
      Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
      Building wheels for collected packages: pycairo
        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
        ╰─> [15 lines of output]
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.linux-x86_64-cpython-311
            creating build/lib.linux-x86_64-cpython-311/cairo
            copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-311/cairo
            copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-311/cairo
            copying cairo/py.typed -> build/lib.linux-x86_64-cpython-311/cairo
            running build_ext
            Package xau was not found in the pkg-config search path.
            Perhaps you should add the directory containing `xau.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'xau', required by 'xcb', not found
            Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
            [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
      
      [notice] A new release of pip is available: 23.3.2 -> 24.0
      [notice] To update, run: pip install --upgrade pip
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

PKG_CONFIG_PATH is empty, so it defaults to /usr/share/pkgconfig which has some .pc files but not pycairo

All error messages suggest you are missing cairo.

See https://pycairo.readthedocs.io/en/latest/getting_started.html#getting-started for how to install it.

I don't know how to do that best with codespaces as I don't have much experience with it.