当前位置:   article > 正文

error: subprocess-exited-with-error 及Package cairo was not found in the pkg-config search path.解决_getting requirements to build wheel ... error erro

getting requirements to build wheel ... error error: subprocess-exited-with-

 

今天使用Stable Diffusion时,按照常规升级插件,升级后SD启动遇到了报错问题:

  1. Collecting pycairo>=1.20.0
  2. Using cached pycairo-1.23.0.tar.gz (344 kB)
  3. Installing build dependencies: started
  4. Installing build dependencies: finished with status 'done'
  5. Getting requirements to build wheel: started
  6. Getting requirements to build wheel: finished with status 'done'
  7. Installing backend dependencies: started
  8. Installing backend dependencies: finished with status 'done'
  9. Preparing metadata (pyproject.toml): started
  10. Preparing metadata (pyproject.toml): finished with status 'done'
  11. Building wheels for collected packages: pycairo
  12. Building wheel for pycairo (pyproject.toml): started
  13. Building wheel for pycairo (pyproject.toml): finished with status 'error'
  14. Failed to build pycairo
  15. stderr: error: subprocess-exited-with-error
  16. × Building wheel for pycairo (pyproject.toml) did not run successfully.
  17. exit code: 1
  18. ╰─> [15 lines of output]
  19. running bdist_wheel
  20. running build
  21. running build_py
  22. creating build
  23. creating build/lib.macosx-13-arm64-cpython-310
  24. creating build/lib.macosx-13-arm64-cpython-310/cairo
  25. copying cairo/__init__.py -> build/lib.macosx-13-arm64-cpython-310/cairo
  26. copying cairo/__init__.pyi -> build/lib.macosx-13-arm64-cpython-310/cairo
  27. copying cairo/py.typed -> build/lib.macosx-13-arm64-cpython-310/cairo
  28. running build_ext
  29. Package cairo was not found in the pkg-config search path.
  30. Perhaps you should add the directory containing `cairo.pc'
  31. to the PKG_CONFIG_PATH environment variable
  32. No package 'cairo' found
  33. Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
  34. [end of output]
  35. note: This error originates from a subprocess, and is likely not a problem with pip.
  36. ERROR: Failed building wheel for pycairo
  37. ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
  38. [notice] A new release of pip is available: 23.0 -> 23.1.2
  39. [notice] To update, run: pip install --upgrade pip
  40. Warning: Failed to install svglib, some preprocessors may not work.

仔细看了一下 是controlnet插件更新后,按装svglib 出现了问题:

  1. Installing sd-webui-controlnet requirement: svglib
  2. Couldn't install sd-webui-controlnet requirement: svglib.
  3. Command: "/Users/glodcrab/AI2IMG/stable-diffusion-webui/venv/bin/python3.10" -m pip install svglib --prefer-binary
  4. Error code: 1

这里的问题主要是pycairo只是对cairo包的Python绑定。但是cairo 包 并不会被pip进行安装。

在这里,我们通过 Homebrew先安装它。brew install cairo。然后再重新启动SD即可。问题解决。

Mac下解决此问题:

  1. brew install pkg-config
  2. brew install cairo
  3. pip install pycairo

Linux下解决此问题:

  1. sudo apt-get update -y
  2. sudo apt-get install -y pkg-config
  3. sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
  4. sudo pip install pycairo

可以看到问题解决:

Installing requirements

Installing sd-webui-controlnet requirement: svglib

Installing sd-dynamic-prompts requirements.txt

Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate

No module 'xformers'. Proceeding without it.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/47051
推荐阅读
相关标签
  

闽ICP备14008679号