在python3.5.2 Windows 10中安装Face_recognition时出错?

时间:2019-01-09 11:11:13

标签: python python-3.x

我已经拥有dlib 19.1.0,并使用

打开cv 3.4.5和具有高级版本的numpy,scipy软件包。
pip install face_recognition

我遇到以下错误。.请任何人能帮助我我做错了..

Collecting face_recognition
  Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Requirement already satisfied: numpy in c:\python35\lib\site-packages (from face_recognition) (1.15.4)
Collecting dlib>=19.7 (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz
Collecting face-recognition-models>=0.3.0 (from face_recognition)
Requirement already satisfied: Click>=6.0 in c:\python35\lib\site-packages (from face_recognition) (7.0)
Requirement already satisfied: Pillow in c:\python35\lib\site-packages (from face_recognition) (5.4.1)
Building wheels for collected packages: dlib
  Running setup.py bdist_wheel for dlib ... error
  Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rqlch36v\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Admin\AppData\Local\Temp\pip-wheel-de03y7mf --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  package init file 'dlib\__init__.py' not found (or not a regular file)
  running build_ext
  Traceback (most recent call last):
    File "c:\python35\lib\runpy.py", line 184, in _run_module_as_main
      "__main__", mod_spec)
    File "c:\python35\lib\runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "C:\python35\Scripts\cmake.exe\__main__.py", line 5, in <module>
  ImportError: cannot import name 'cmake'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 257, in <module>
      'Topic :: Software Development',
    File "c:\python35\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\python35\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "c:\python35\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\python35\lib\site-packages\wheel\bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\python35\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\python35\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\python35\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 127, in run
      cmake_version = self.get_cmake_version()
    File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 118, in get_cmake_version
      out = subprocess.check_output(['cmake', '--version'])
    File "c:\python35\lib\subprocess.py", line 626, in check_output
      **kwargs).stdout
    File "c:\python35\lib\subprocess.py", line 708, in run
      output=stdout, stderr=stderr)
  subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1

  ----------------------------------------
  Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition-models, face-recognition
  Found existing installation: dlib 19.1.0
    Uninstalling dlib-19.1.0:
      Successfully uninstalled dlib-19.1.0
  Running setup.py install for dlib ... error
    Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rqlch36v\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Admin\AppData\Local\Temp\pip-record-tjyw2jml\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    package init file 'dlib\__init__.py' not found (or not a regular file)
    running build_ext
    Traceback (most recent call last):
      File "c:\python35\lib\runpy.py", line 184, in _run_module_as_main
        "__main__", mod_spec)
      File "c:\python35\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\python35\Scripts\cmake.exe\__main__.py", line 5, in <module>
    ImportError: cannot import name 'cmake'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 257, in <module>
        'Topic :: Software Development',
      File "c:\python35\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\python35\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\python35\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\python35\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\python35\lib\distutils\command\install.py", line 539, in run
        self.run_command('build')
      File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\python35\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\python35\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\python35\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 127, in run
        cmake_version = self.get_cmake_version()
      File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 118, in get_cmake_version
        out = subprocess.check_output(['cmake', '--version'])
      File "c:\python35\lib\subprocess.py", line 626, in check_output
        **kwargs).stdout
      File "c:\python35\lib\subprocess.py", line 708, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1

    ----------------------------------------
  Rolling back uninstall of dlib
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rqlch36v\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Admin\AppData\Local\Temp\pip-record-tjyw2jml\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\

实际上,我尝试使用其他一些安装关键字,并试图纠正错误,但是当我使用pip install face_recognition时遇到了相同的错误,而我的python版本是3.5.2,并且我尝试了使用指定版本的python和face_recognition的wheel文件。 以下车轮文件是我尝试过的车轮文件.. https://pypi.org/simple/face-recognition/

1 个答案:

答案 0 :(得分:1)

你好这个问题制作这个

第 1 步:

pip install cmake dlib

第 2 步:

pip install face-recognition
<块引用>

如果你有 dlib 的问题,请检查这个

sudo apt install python3-dev