【问题标题】:Not able to install face_recognition module in pyton无法在python中安装face_recognition模块
【发布时间】:2023-02-22 02:05:11
【问题描述】:

当我尝试为 python 安装 face_recognition 模块时,我在 Windows 10 上安装了 python 3.6 我收到以下错误 当 pip 尝试安装 dlib 时它给了我错误

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\acer\appdata\local\programs\python\python36-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\setup.py'"'"'; __file__='"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\acer\AppData\Local\Temp\pip-record-3ig35xio\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\acer\appdata\local\programs\python\python36-32\Include\dlib'    
         cwd: C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\
    Complete output (59 lines):
    running install
    c:\users\acer\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      setuptools.SetuptoolsDeprecationWarning,
    running build
    running build_py
    package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
    running build_ext
    Building extension for Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
    Invoking CMake setup: 'cmake C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\build\lib.win32-3.6 -DPYTHON_EXECUTABLE=c:\users\acer\appdata\local\programs\python\python36-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\build\lib.win32-3.6'
    -- Building for: Visual Studio 17 2022
    -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
    -- The C compiler identification is unknown
    -- The CXX compiler identification is unknown
    CMake Error at CMakeLists.txt:14 (project):
      No CMAKE_C_COMPILER could be found.



    CMake Error at CMakeLists.txt:14 (project):
      No CMAKE_CXX_COMPILER could be found.



    -- Configuring incomplete, errors occurred!
    See also "C:/Users/acer/AppData/Local/Temp/pip-install-cljzfpu6/dlib_351488587aea427493530fa6c8e1bf03/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/acer/AppData/Local/Temp/pip-install-cljzfpu6/dlib_351488587aea427493530fa6c8e1bf03/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\__init__.py", line 159, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py", line 68, in run
        return orig.install.run(self)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\setup.py", line 134, in run
        self.build_extension(ext)
      File "C:\Users\acer\AppData\Local\Temp\pip-install-cljzfpu6\dlib_351488587aea427493530fa6c8e1bf03\setup.py", line 171, in build_extension    
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "c:\users\acer\appdata\local\programs\python\python36-32\lib\subprocess.py", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\build\\lib.win32-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\acer\\appdata\\local\\programs\\python\\python36-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\build\\lib.win32-3.6']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\acer\appdata\local\programs\python\python36-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\setup.py'"'"'; __file__='"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-cljzfpu6\\dlib_351488587aea427493530fa6c8e1bf03\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\acer\AppData\Local\Temp\pip-record-3ig35xio\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\acer\appdata\local\programs\python\python36-32\Include\dlib' Check the logs for full command output

我尝试了所有可能的方法来解决这个错误 我自己 请帮我解决这个错误

【问题讨论】:

    标签: python-3.6


    【解决方案1】:

    “为 dlib 使用旧版‘setup.py install’,因为未安装包‘wheel’。”

    也许试试pip install wheel

    【讨论】:

      猜你喜欢
      • 2021-11-10
      • 1970-01-01
      • 2019-11-03
      • 2021-12-07
      • 2019-02-23
      • 2020-05-30
      • 2019-07-07
      • 1970-01-01
      • 2023-02-07
      相关资源
      最近更新 更多