使用pip安装face_recognition
结果报错:
Building wheel for dlib (setup.py) … error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [41 lines of output]
running bdist_wheel
running build
running build_ext
CMake is not installed on your system!
Or it is possible some broken copy of cmake is installed on your system.
It is unfortunately very common for python package managers to include
broken copies of cmake. So if the error above this refers to some file
path to a cmake file inside a python or anaconda or miniconda path then you
should delete that broken copy of cmake from your computer.
……
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)
解决办法:
先运行: pip install cmake
最后显示:Successfully installed cmake-3.30.3表示安装成功
再运行: pip install boost
最后显示:Successfully installed Mastodon.py-1.8.1 blurhash-1.1.4 boost-0.1 python-magic-bin-0.4.14表示安装成功
(注意上面版本可能与你电脑不一致,这个取决于环境)
两个都显示安装成功以后,再运行:pip install face_recognition
显示下面这个就表示安装成功:
Successfully installed dlib-19.24.6 face-recognition-models-0.3.0 face_recognition-1.3.0