Please install `face_recognition_models` with this command before using `face_recognition`

python3.6.13
face-recognition 1.3.0
face-recognition-models 0.3.0
cmake 3.27.0
dlib 19.7.0

运行代码报错:


Please install `face_recognition_models` with this command before using `face_recognition`:

pip install git+https://github.com/ageitgey/face_recognition_models

请问有人能解决这个问题吗?

参考:


用户对问题“为什么face_recognition模块在Python语言中不能工作?”的回答 - 问答 - 腾讯云开发者社区-腾讯云 我正在用Python编写一个人脸识别脚本。我正在使用Python语言中的face_recognition模块。但是当我运行代码时,我得到的输出是: Please install `face_reco... https://cloud.tencent.com/developer/ask/sof/1155269/answer/1611152

你用的Python 3.6.13,并尝试运行使用facerecognition库的代码。遇到的错误提示需要安装facerecognition_models。
facerecognitionmodels是facerecognition库的一个依赖库,负责提供训练好的人脸检测模型。为了解决这个问题,可以按照给出的命令使用pip安装facerecognition_models。请确保你的计算机上已安装git,并在命令行中执行以下命令:
pip install git+https://github.com/ageitgey/face_recognition_models

这将使用git将facerecognitionmodels库从GitHub上克隆到你的本地Python环境中。
然后,再次运行你的代码,它应该能够成功导入face_recognition库并使用相关功能。
请注意,确保你具有足够的权限以安装和更新Python库。在某些情况下,可能需要在命令前添加sudo(针对Linux和macOS系统)或以管理员身份运行命令提示符(针对Windows系统)。