微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我已经安装了 C++,但在 Visual Studio 中使用 pip 安装 face_recognition 时仍然出错

如何解决我已经安装了 C++,但在 Visual Studio 中使用 pip 安装 face_recognition 时仍然出错

$ 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\nhdbr\appdata\local\programs\python\python38-32\lib\site-packages (from face_recognition) (0.3.0)
Requirement already satisfied: Click>=6.0 in c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\site-packages (from face_recognition) (7.1.2)       
Requirement already satisfied: Pillow in c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\site-packages (from face_recognition) (7.2.0)
Requirement already satisfied: numpy in c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\site-packages (from face_recognition) (1.19.1)
Collecting dlib>=19.7
  Using cached dlib-19.22.0.tar.gz (7.4 MB)
Using legacy 'setup.py install' for dlib,since package 'wheel' is not installed.
Installing collected packages: dlib,face-recognition
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\nhdbr\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\setup.py'"'"'; __file__='"'"'C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\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\NHDBR\AppData\Local\Temp\pip-record-kpaswjea\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\nhdbr\appdata\local\programs\python\python38-32\Include\dlib'
         cwd: C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\
    Complete output (60 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
    Building extension for Python 3.8.5 (tags/v3.8.5:580fbb0,Jul 20 2020,15:43:08) [MSC v.1926 32 bit (Intel)]
    Invoking CMake setup: 'cmake C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=c:\users\nhdbr\appdata\local\programs\python\python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\build\lib.win32-3.8'
    -- Building for: NMake Makefiles
    CMake Error at CMakeLists.txt:5 (message):



      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


      You must use Visual Studio to build a python extension on windows.  If you
      are getting this error it means you have not installed Visual C++.  Note
      that there are many flavors of Visual Studio,like Visual Studio for C#
      development.  You need to install Visual Studio for C++.


      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!




    -- Configuring incomplete,errors occurred!
    Traceback (most recent call last):
      File "<string>",line 1,in <module>
      File "C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\setup.py",line 222,in <module>
        setup(
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py",line 144,in setup
        return distutils.core.setup(**attrs)
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\core.py",line 148,in setup
        dist.run_commands()
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\dist.py",line 966,in run_commands
        self.run_command(cmd)
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\dist.py",line 985,in run_command
        cmd_obj.run()
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\install.py",line 61,in run
        return orig.install.run(self)
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\command\install.py",line 545,in run
        self.run_command('build')
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\cmd.py",line 313,in run_command
        self.distribution.run_command(command)
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\dist.py",in run_command
        cmd_obj.run()
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\command\build.py",line 135,in run
        self.run_command(cmd_name)
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\distutils\cmd.py",in run_command
        cmd_obj.run()
      File "C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\setup.py",line 134,in run
        self.build_extension(ext)
      File "C:\Users\NHDBR\AppData\Local\Temp\pip-install-r0zorguv\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\setup.py",line 171,in build_extension
        subprocess.check_call(cmake_setup,cwd=build_folder)
      File "c:\users\nhdbr\appdata\local\programs\python\python38-32\lib\subprocess.py",line 364,in check_call
        raise CalledProcessError(retcode,cmd)
    subprocess.CalledProcessError: Command '['cmake','C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\tools\\python','-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\build\\lib.win32-3.8','-DPYTHON_EXECUTABLE=c:\\users\\nhdbr\\appdata\\local\\programs\\python\\python38-32\\python.exe','-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\build\\lib.win32-3.8']' returned non-zero exit status 1.    
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\nhdbr\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys,tokenize; 
sys.argv[0] = '"'"'C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\setup.py'"'"'; __file__='"'"'C:\\Users\\NHDBR\\AppData\\Local\\Temp\\pip-install-r0zorguv\\dlib_c1ff13c1e34a4967a90bb4c0b9d26978\\setup.py'"'"';f=getattr(tokenize,'"'"'exec'"'"'))' install --record 'C:\Users\NHDBR\AppData\Local\Temp\pip-record-kpaswjea\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\nhdbr\appdata\local\programs\python\python38-32\Include\dlib' Check the logs for full command output.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。