问题:
hon -I/tmp/pip-build-env-eoaar12h/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/xd/stable-diffusion-webui/venv/include -I/usr/include/python3.10 -c insightface/thirdparty/face3d/mesh/cython/mesh_core.cpp -o build/temp.linux-x86_64-cpython-310/insightface/thirdparty/face3d/mesh/cython/mesh_core.o
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Iinsightface/thirdparty/face3d/mesh/cython -I/tmp/pip-build-env-eoaar12h/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/xd/stable-diffusion-webui/venv/include -I/usr/include/python3.10 -c insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpp -o build/temp.linux-x86_64-cpython-310/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.o insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpp:36:10: fatal error: Python.h: No such file or directory 36 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for insightface
Failed to build insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects
It looks like there is a compilation error while trying to build the insightface
package, and the error is related to the absence of the Python.h
file. This file is part of the Python development headers and is needed to build Python C extensions.
解决:
To resolve this issue, you need to install the Python development headers. The process to install these headers varies depending on your operating system.
bashsudo apt-get install python3-dev
!!!!!!!!!!!!!!!!!!
我是python3.10,我后面尝试了sudo apt-get install python3.10-dev,非常好用。
bashsudo dnf install python3-devel
bashxcode-select --install
After installing the Python development headers, try installing the insightface
package again:
bashpip install insightface
This should resolve the issue you're facing. If you encounter any additional errors or have specific requirements for the insightface
package, you may need to install additional dependencies as indicated in the package documentation.
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!