python安装face_recognition错误

1,安装face_recognition ,直接pip install face_recognition 报错。

2,先安装 :

pip install cmake==3.12.0 -i https://mirrors.ustc.edu.cn/pypi/web/simple

pip install dlib==19.18.0 -i https://mirrors.ustc.edu.cn/pypi/web/simple

报错了,于是去 dlib · PyPI 下载:备注(whl文件只有老版本的才有,新版本只有tar.gz文件。)

执行如下:报错。

pip install dlib-19.8.1-cp36-cp36m-win_amd64.whl
WARNING: Requirement 'dlib-19.8.1-cp36-cp36m-win_amd64.whl' looks like a filename, but the file does not exist
ERROR: dlib-19.8.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

然后根据百度,查找python支持的包版本,执行

python
import pip._internal
print(pip._internal.pep425tags.get_supported())
报错
File "", line 1, in 
AttributeError: module 'pip._internal' has no attribute 'pep425tags'

于是:直接用pip debug --verbose 命令即可看 pip 支持。

pip debug --verbose
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 21.3.1 from d:\python\anaconda3\lib\site-packages\pip (python 3.7)
sys.version: 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)]
sys.executable: d:\python\anaconda3\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp936
sys.platform: win32
sys.implementation:
  name: cpython
'cert' config value: Not specified
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): d:\python\anaconda3\lib\site-packages\pip\_vendor\certifi\cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
  CacheControl==0.12.6
  colorama==0.4.4
  distlib==0.3.3
  distro==1.6.0
  html5lib==1.1
  msgpack==1.0.2 (Unable to locate actual module version, using vendor.txt specified version)
  packaging==21.0
  pep517==0.12.0
  platformdirs==2.4.0
  progress==1.6
  pyparsing==2.4.7
  requests==2.26.0
  certifi==2021.05.30
  chardet==4.0.0
  idna==3.2
  urllib3==1.26.7
  resolvelib==0.8.0
  setuptools==44.0.0 (Unable to locate actual module version, using vendor.txt specified version)
  six==1.16.0
  tenacity==8.0.1 (Unable to locate actual module version, using vendor.txt specified version)
  tomli==1.0.3
  webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 27
  cp37-cp37m-win_amd64
  cp37-abi3-win_amd64
  cp37-none-win_amd64
  cp36-abi3-win_amd64
  cp35-abi3-win_amd64
  cp34-abi3-win_amd64
  cp33-abi3-win_amd64
  cp32-abi3-win_amd64
  py37-none-win_amd64
  py3-none-win_amd64
  py36-none-win_amd64
  py35-none-win_amd64
  py34-none-win_amd64
  py33-none-win_amd64
  py32-none-win_amd64
  py31-none-win_amd64
  py30-none-win_amd64
  cp37-none-any
  py37-none-any
  py3-none-any
  py36-none-any
  py35-none-any
  py34-none-any
  py33-none-any
  py32-none-any
  py31-none-any
  py30-none-any

如上图:感觉要么名字包含py36-none-win_amd64,或者py36-none-win_amd64,然后根据路径还是执行了(后面报错了,发现名字是py36,不是cp36.然后看了whl包,没有Py开头的)

pip install dlib-19.8.1-cp36-cp36m-win_amd64.whl -i https://mirrors.ustc.edu.cn/pypi/web/simple
pip install dlib-19.8.1-cp36-cp36m-win_amd64.whl -i https://mirrors.bfsu.edu.cn/pypi/web/simple

但是都报错了:

WARNING: Requirement 'dlib-19.8.1-cp36-cp36m-win_amd64.whl' looks like a filename, but the file does not exist
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
ERROR: dlib-19.8.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

又从百度上看到了这种:

python安装face_recognition错误_第1张图片

 于是下载到本地,执行

 C:\Users\Administrator>pip install C:\Users\Administrator\Downloads\dlib-19.8.1-cp36-cp36m-win_amd64.whl

还是报(dlib-19.8.1-cp36-cp36m-win_amd64.whl)错:还是名字不对。

然后一个个试,试出
 

import wheel.pep425tags as w
>>> print(w)

>>> print(w.get_supported())
D:\Python\Anaconda3\lib\site-packages\wheel\pep425tags.py:75: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
D:\Python\Anaconda3\lib\site-packages\wheel\pep425tags.py:79: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('cp36', 'none', 'any'), ('cp35', 'none', 'any'), ('cp34', 'none', 'any'), ('cp33', 'none', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', 'any'), ('py3', 'none', 'win_amd64'), ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]

我感觉 pip install dlib-18.17.100-cp35-none-win_amd64.whl 符合 ('cp35', 'none', 'any'),但是还是报之前红色错误。然后下载到本地看下,也报错。

最后在其它地方,找了dlib-19.17.99-cp37-cp37m-win_amd64.whl,安装成功。

期间,学了下python : 调用百度AipFace做人脸检测_luckyfairy17的博客-CSDN博客_aipface

然后直接下载:pip install face_recognition 下的很慢,还报错

改为:pip install -i https://mirrors.aliyun.com/pypi/simple face_recognition

成功。

发现,要百度,直接加条件,之前写python安装face_recognition,各种报错。

改为:python3.7 安装 face_recognition ,直接查到了

Windows Python3.7 如何安装dlib和face_recognition_拔牙不打麻药-CSDN博客

最后安装成功。

你可能感兴趣的:(python,开发语言,后端)