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

[Bug]: pycairo / svglib #1234

Closed
1 task done
Chilluminati91 opened this issue May 13, 2023 · 6 comments
Closed
1 task done

[Bug]: pycairo / svglib #1234

Chilluminati91 opened this issue May 13, 2023 · 6 comments

Comments

@Chilluminati91
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

Starting the webui with installed controlnet extension always displays the error related to pycairo and svglib. Does launch but stalls the startup for a bit.

Steps to reproduce the problem

  1. completely delete venv to clean
  2. startup webui and install the extension
  3. restart and see the output

What should have happened?

properly install svglib / pycairo?!

Commit where the problem happens

webui: b08500ce
controlnet: [4c111ec]

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--autolaunch --opt-sdp-attention

Console logs

Installing sd-webui-controlnet requirement: mediapipe
Installing sd-webui-controlnet requirement: svglib
Couldn't install sd-webui-controlnet requirement: svglib.
Command: "/home/liam/stable-diffusion-webui/venv/bin/python3" -m pip install svglib --prefer-binary
Error code: 1
stdout: Collecting svglib
  Using cached svglib-1.5.1-py3-none-any.whl
Collecting tinycss2>=0.6.0
  Using cached tinycss2-1.2.1-py3-none-any.whl (21 kB)
Collecting reportlab
  Using cached reportlab-4.0.0-py3-none-any.whl (1.9 MB)
Collecting cssselect2>=0.2.0
  Using cached cssselect2-0.7.0-py3-none-any.whl (15 kB)
Collecting lxml
  Using cached lxml-4.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.1 MB)
Collecting webencodings
  Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting freetype-py<2.4,>=2.3.0
  Using cached freetype_py-2.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (978 kB)
Collecting rlPyCairo<1,>=0.2.0
  Using cached rlPyCairo-0.2.0-py3-none-any.whl (10 kB)
Requirement already satisfied: pillow>=9.0.0 in ./venv/lib/python3.10/site-packages (from reportlab->svglib) (9.4.0)
Collecting pycairo>=1.20.0
  Using cached pycairo-1.23.0.tar.gz (344 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'
Building wheels for collected packages: pycairo
  Building wheel for pycairo (pyproject.toml): started
  Building wheel for pycairo (pyproject.toml): finished with status 'error'
Failed to build pycairo

stderr:   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-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
      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
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects


Warning: Failed to install svglib, some preprocessors may not work.
Installing sd-webui-controlnet requirement: fvcore

Additional information

No response

@wilzamguerrero
Copy link

same here

@rundercubus
Copy link

rundercubus commented May 14, 2023

same problem with python 3.10.10 and runing on runpod

SOLVED: finally it was a browser problem with Brave,...... installation worked with the correcton of "libcairo2-dev" installing it first but the preprocessors don't work in the Brave Browser

@NoCrypt
Copy link

NoCrypt commented May 14, 2023

I ran apt-get install sox ffmpeg libcairo2 libcairo2-dev first and it works

@wilzamguerrero
Copy link

for me work this

!pip install svglib
!sudo apt-get install libcairo2-dev

@Chris-wa-He
Copy link

The error message “Building wheel for pycairo (pyproject.toml) did not run successfully” is usually caused by a missing dependency. Specifically, the error message “fatal error: Python.h: No such file or directory” indicates that the Python development headers are not installed on your system. You can try installing them using the following command:
sudo apt-get install python3-dev

If that doesn’t work, you can try installing the cairo library using the following command:
sudo apt-get install libcairo2-dev

@LittleLizzie24
Copy link

does anyone have ways to fix this for manjaro linux? since the latest update i get this exact same issue on both torch 1.13 and 2
pip install svglib into the venv breaks locon/doesnt fix it
sudo pamac cairo didnt work
idk what to do

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

7 participants