我的系统是win10,首先使用anaconda创建一个虚拟环境,python>=3.8,但也不要太新(python版本太新可能会有很多库的版本出问题)
先安装dlib库,再安装face_recognition
在创建的虚拟环境里安装这两个库
pip install dlib -i https://pypi.tuna.tsinghua.edu.cn/simple
可能会出现如下报错(很大可能):
Failed to build dlib, ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
解决这个问题可以使用这个命令:
conda install -c conda-forge dlib
这样应该可以解决dlib库的安装问题
在安装完dlib之后安装face_recognition
使用命令:
pip install face_recognition -i https://pypi.tuna.tsinghua.edu.cn/simple
这样应该就可以安装完成