0

When I run command

pip install dlib==19.18.0

the error below appears:

amd64-cpython-310', '-DPYTHON_EXECUTABLE=C:\\Users\\ASUS\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\ASUS\\AppData\\Local\\Temp\\pip-install-e2j7rtug\\dlib_5512cdae6fa04c2886bfa3506800a523\\build\\lib.win-amd64-cpython-310', '-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
  ╰─> [74 lines of output]
      running install
      C:\Users\ASUS\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
      running build_ext
      C:\Users\ASUS\AppData\Local\Temp\pip-install-e2j7rtug\dlib_5512cdae6fa04c2886bfa3506800a523\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.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\ASUS\AppData\Local\Temp\pip-install-e2j7rtug\dlib_5512cdae6fa04c2886bfa3506800a523\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\ASUS\AppData\Local\Temp\pip-install-e2j7rtug\dlib_5512cdae6fa04c2886bfa3506800a523\build\lib.win-amd64-cpython-310 -DPYTHON_EXECUTABLE=C:\Users\ASUS\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\ASUS\AppData\Local\Temp\pip-install-e2j7rtug\dlib_5512cdae6fa04c2886bfa3506800a523\build\lib.win-amd64-cpython-310 -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\ASUS\AppData\Local\Temp\pip-install-e2j7rtug\dlib_5512cdae6fa04c2886bfa3506800a523\setup.py", line 222, in <module>
          setup(
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 177, in setup
          return run_commands(dist)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 193, in run_commands
          dist.run_commands()
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
          self.run_command(cmd)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
          cmd_obj.run()
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py", line 68, in run
          return orig.install.run(self)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\install.py", line 695, in run
          self.run_command('build')
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 317, in run_command
          self.distribution.run_command(command)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
          cmd_obj.run()
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\build.py", line 24, in run
          super().run()
        File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
PS D:\SkripsiGigaJavapocalypse> C:/Users/ASUS/anaconda3/Scripts/activate
PS D:\SkripsiGigaJavapocalypse> conda activate base
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path wa  
s included, verify that the path is correct and try again.
At line:1 char:1
+ conda activate base
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (conda:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

In my system I have installed:

  • CMake 3.26.3,
  • Python 3.10.6.
Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
GigaTera
  • 782
  • 8
  • 9
  • another extra information this is all my version installed Python : 3.10.6 – GigaTera Jun 19 '23 at 11:19
  • 1
    I would expect a user with 700 reputation to be familiar about proper formatting of error messages and to be aware that additional information about the problem should be added to the question post itself, not in the comments... – Tsyvarev Jun 19 '23 at 11:43
  • Have you installed Visual Studio, as the error message and [that answer](https://stackoverflow.com/a/63648302/3440745) suggest? – Tsyvarev Jun 19 '23 at 11:49

0 Answers0