Seite 1 von 1

Fehler bei installation von face_recognition

Verfasst: Donnerstag 18. Februar 2021, 18:55
von EmilEmilchen
Hallo,
ich habe ein Problem: wenn ich versuche face recognition zu installieren passiert folgendes:

Code: Alles auswählen

C:\Windows\system32>pip install face_recognition
Collecting face_recognition
  Using cached face_recognition-1.3.0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\emilm\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from face_recognition) (0.3.0)
Collecting Click>=6.0
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Requirement already satisfied: Pillow in c:\users\emilm\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from face_recognition) (8.1.0)
Collecting dlib>=19.7
  Using cached dlib-19.21.1.tar.gz (3.6 MB)
Requirement already satisfied: numpy in c:\users\emilm\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from face_recognition) (1.20.1)
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib, Click, face-recognition
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\emilm\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\emilm\\AppData\\Local\\Temp\\pip-install-ijc46a8p\\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\\setup.py'"'"'; __file__='"'"'C:\\Users\\emilm\\AppData\\Local\\Temp\\pip-install-ijc46a8p\\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\\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\emilm\AppData\Local\Temp\pip-record-mbgxxfut\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\emilm\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\dlib'
         cwd: C:\Users\emilm\AppData\Local\Temp\pip-install-ijc46a8p\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\
    Complete output (55 lines):
    running install
    running build
    running build_py
    package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
    running build_ext
    Traceback (most recent call last):
      File "C:\Users\emilm\AppData\Local\Temp\pip-install-ijc46a8p\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\setup.py", line 120, in get_cmake_version
        out = subprocess.check_output(['cmake', '--version'])
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 420, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 501, in run
        with Popen(*popenargs, **kwargs) as process:
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 947, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1416, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
    FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\emilm\AppData\Local\Temp\pip-install-ijc46a8p\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\setup.py", line 223, in <module>
        setup(
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\__init__.py", line 165, in setup
        return distutils.core.setup(**attrs)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 546, in run
        self.run_command('build')
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\emilm\AppData\Local\Temp\pip-install-ijc46a8p\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\setup.py", line 129, in run
        cmake_version = self.get_cmake_version()
      File "C:\Users\emilm\AppData\Local\Temp\pip-install-ijc46a8p\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\setup.py", line 122, in get_cmake_version
        raise RuntimeError("\n*******************************************************************\n" +
    RuntimeError:
    *******************************************************************
     CMake must be installed to build the following extensions: _dlib_pybind11
    *******************************************************************

    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\emilm\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\emilm\\AppData\\Local\\Temp\\pip-install-ijc46a8p\\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\\setup.py'"'"'; __file__='"'"'C:\\Users\\emilm\\AppData\\Local\\Temp\\pip-install-ijc46a8p\\dlib_ea400db6ec7d405295cb60fbcd3e9fa7\\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\emilm\AppData\Local\Temp\pip-record-mbgxxfut\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\emilm\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\dlib' Check the logs for full command output.

C:\Windows\system32>
Ich hoffe mir kann jemand helfen, danke im vorraus!
MFG Emil

Re: Fehler bei installation von face_recognition

Verfasst: Donnerstag 18. Februar 2021, 19:06
von __deets__
Versuche es mal mir Python 3.8. Oder mit anaconda. Sonst mit Linux.

Re: Fehler bei installation von face_recognition

Verfasst: Freitag 19. Februar 2021, 09:00
von EmilEmilchen
Danke, aber ich habe es bereits mit Anaconda3 und Kali Linux getestet. Leider ohne Erfolg.

Re: Fehler bei installation von face_recognition

Verfasst: Freitag 19. Februar 2021, 09:18
von __deets__
Was die Fehlermeldung sagt: du musst eine Erweiterung kompilieren, und dafür eben alles da haben. Cmake, Compiler, header für Bibliotheken. Das geht vielleicht auch für Windows, aber sowas ist üblicherweise vieeel einfacher auf unixoiden. Mehr kann man so leider nicht raten.

Re: Fehler bei installation von face_recognition

Verfasst: Freitag 19. Februar 2021, 11:48
von __blackjack__
Hinweis: Das betroffene `dlib`-Package gibt es im Package-Index nur als Quelltextarchiv. Das muss also auf jeden Fall kompiliert werden wenn man es von dort bezieht.

Re: Fehler bei installation von face_recognition

Verfasst: Mittwoch 24. Februar 2021, 17:48
von EmilEmilchen
Ich habe jetzt einfach mal

Code: Alles auswählen

pip install cmake
pip install compiler
gemacht, jetzt scheint es zu gehen, vielen Dank für die Hilfe!

Re: Fehler bei installation von face_recognition

Verfasst: Mittwoch 24. Februar 2021, 18:07
von __blackjack__
Das ist ja krass, das ist tatsächlich CMake als wheel-Datei für verschiedene Systeme.

Das `compiler`-Package ist aber quatsch und ein bisschen schräg weil die Projektbeschreibung nicht zum `vlde`-Modul passt was da dann tatsächlich mit installiert wird. Dessen README ist von den Code-Snippets abgesehen in Chinesisch: https://github.com/xiaojieluo/vlde