鱼C论坛

 找回密码
 立即注册
查看: 1801|回复: 6

[已解决]关于pip下载的问题

[复制链接]
发表于 2022-3-27 13:34:49 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
C:\Users\Administrator>pip install dlib
Collecting dlib
  Using cached dlib-19.23.1.tar.gz (7.4 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [69 lines of output]
      running bdist_wheel
      running build
      running build_py
      package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
      running build_ext
      C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -A x64'
      -- 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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 222, in <module>
          setup(
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 79, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
          return run_commands(dist)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
          dist.run_commands()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
  Running setup.py install for dlib ... error
  error: subprocess-exited-with-error

  × Running setup.py install for dlib did not run successfully.
  │ exit code: 1
  ╰─> [73 lines of output]
      running install
      C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
      running build_ext
      C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -A x64'
      -- 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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 222, in <module>
          setup(
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 79, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
          return run_commands(dist)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
          dist.run_commands()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py", line 68, in run
          return orig.install.run(self)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\install.py", line 670, in run
          self.run_command('build')
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

大佬们,帮我看一下这是怎么回事啊,去CSDN,贴吧搜方法,用了都不管用,一次次下载不了
最佳答案
2022-3-27 16:13:37
链接:https://pan.baidu.com/s/103ny86xtUHyIuZKt4vKc6A 
提取码:tvfs

安装方法:
1. 打开powershell
2. cd至dlib-19.23.1-cp310-cp310-win_amd64.whl所在目录(或在dlib-19.23.1-cp310-cp310-win_amd64.whl所在目录打开powershell)
3. 输入命令安装:
pip install dlib-19.23.1-cp310-cp310-win_amd64.whl



想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2022-3-27 13:40:14 | 显示全部楼层
难道是我换版本就不行了?(3.8换成3.10)还是win10镜像的问题(这个电脑本来就是win10的,重装了几次,难道是替换的system文件的问题?)
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-3-27 13:40:49 From FishC Mobile | 显示全部楼层
本帖最后由 hrpzcf 于 2022-3-27 13:41 编辑

先安装vs并安装C++工作负载再pip install dlib,或者去https://www.lfd.uci.edu/~gohlke/pythonlibs/看看有没有现成的安装包,有的话下载对应版本,用"pip install  文件路径文件名"安装
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-3-27 14:00:52 | 显示全部楼层
hrpzcf 发表于 2022-3-27 13:40
先安装vs并安装C++工作负载再pip install dlib,或者去https://www.lfd.uci.edu/~gohlke/pythonlibs/看看有 ...
C:\Users\Administrator>pip install C:\Users\Administrator\Desktop\dlib-master
Processing c:\users\administrator\desktop\dlib-master
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [69 lines of output]
      running bdist_wheel
      running build
      running build_py
      package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
      running build_ext
      C:\Users\Administrator\Desktop\dlib-master\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\Administrator\Desktop\dlib-master\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\Desktop\dlib-master\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\Desktop\dlib-master\build\lib.win-amd64-3.10 -A x64'
      -- 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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\Desktop\dlib-master\setup.py", line 222, in <module>
          setup(
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 79, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
          return run_commands(dist)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
          dist.run_commands()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\Desktop\dlib-master\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\Administrator\Desktop\dlib-master\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\Desktop\\dlib-master\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\Desktop\\dlib-master\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\Desktop\\dlib-master\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
  Running setup.py install for dlib ... error
  error: subprocess-exited-with-error

  × Running setup.py install for dlib did not run successfully.
  │ exit code: 1
  ╰─> [73 lines of output]
      running install
      C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
      running build_ext
      C:\Users\Administrator\Desktop\dlib-master\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\Administrator\Desktop\dlib-master\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\Desktop\dlib-master\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\Desktop\dlib-master\build\lib.win-amd64-3.10 -A x64'
      -- 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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\Desktop\dlib-master\setup.py", line 222, in <module>
          setup(
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 79, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
          return run_commands(dist)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
          dist.run_commands()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py", line 68, in run
          return orig.install.run(self)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\install.py", line 670, in run
          self.run_command('build')
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\Desktop\dlib-master\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\Administrator\Desktop\dlib-master\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\Desktop\\dlib-master\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\Desktop\\dlib-master\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\Desktop\\dlib-master\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
两个都失败了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-3-27 15:55:51 From FishC Mobile | 显示全部楼层
__add__ 发表于 2022-3-27 14:00
两个都失败了

等会我帮你编译吧,py3.10, win10 x64是吗?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-3-27 16:13:37 | 显示全部楼层    本楼为最佳答案   
链接:https://pan.baidu.com/s/103ny86xtUHyIuZKt4vKc6A 
提取码:tvfs

安装方法:
1. 打开powershell
2. cd至dlib-19.23.1-cp310-cp310-win_amd64.whl所在目录(或在dlib-19.23.1-cp310-cp310-win_amd64.whl所在目录打开powershell)
3. 输入命令安装:
pip install dlib-19.23.1-cp310-cp310-win_amd64.whl



想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-3-27 17:49:17 | 显示全部楼层
谢谢大佬!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-1-11 22:52

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表