Encountered error while trying to install package dlib

I'm trying to install dlib. I followed every single tip on the internet but its just not working. I'm using/tried windows 10 cmake 3.21.4 (it's on path) python 3.8.12 and 3.6.4 conda 4.10.3 pip 21...

I’m trying to install dlib. I followed every single tip on the internet but its just not working.
I’m using/tried

  • windows 10
  • cmake 3.21.4 (it’s on path)
  • python 3.8.12 and 3.6.4
  • conda 4.10.3
  • pip 21.3.1
  • visual studio 2019
    components in vs (1)
    components in vs (2)

I have conda and pip installed, tried both with

  • pip install dlib
  • pip install dlib —verbose
  • pip install «some urls»
  • conda install -c conda-forge dlib
  • conda install -c conda-forge/label/cf201901 dlib

The error I’m getting is:

 Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UserssophiAppDataLocalTemppip-install-3w7lgrlbdlib_ffabe5e6a08e472b835f598e7803e3d4setup.py", line 222, in <module>
        setup(
      File "c:userssophianaconda3libsite-packagessetuptools__init__.py", line 159, in setup
        return distutils.core.setup(**attrs)
      File "c:userssophianaconda3libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "c:userssophianaconda3libdistutilsdist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:userssophianaconda3libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "c:userssophianaconda3libsite-packagessetuptoolscommandinstall.py", line 68, in run
        return orig.install.run(self)
      File "c:userssophianaconda3libdistutilscommandinstall.py", line 545, in run
        self.run_command('build')
      File "c:userssophianaconda3libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:userssophianaconda3libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "c:userssophianaconda3libdistutilscommandbuild.py", line 135, in run
        self.run_command(cmd_name)
      File "c:userssophianaconda3libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:userssophianaconda3libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UserssophiAppDataLocalTemppip-install-3w7lgrlbdlib_ffabe5e6a08e472b835f598e7803e3d4setup.py", line 134, in run
        self.build_extension(ext)
      File "C:UserssophiAppDataLocalTemppip-install-3w7lgrlbdlib_ffabe5e6a08e472b835f598e7803e3d4setup.py", line 174, in build_extension
        subprocess.check_call(cmake_build, cwd=build_folder)
      File "c:userssophianaconda3libsubprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
    Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1: 'c:userssophianaconda3python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sophi\AppData\Local\Temp\pip-install-3w7lgrlb\dlib_ffabe5e6a08e472b835f598e7803e3d4\setup.py'"'"'; __file__='"'"'C:\Users\sophi\AppData\Local\Temp\pip-install-3w7lgrlb\dlib_ffabe5e6a08e472b835f598e7803e3d4\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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UserssophiAppDataLocalTemppip-record-kvd3vwdqinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:userssophianaconda3Includedlib' Check the logs for full command output.

For me, it seems like the problem is somethin with the cmake command, but I have no idea what the exact problem is. I used pip install cmake and installed cmake from source, none of both worked.
Has anyone an idea how to solve this?

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

prodemmi opened this issue

Jun 8, 2022

· 11 comments


Closed

pip dlib not installing

#2596

prodemmi opened this issue

Jun 8, 2022

· 11 comments

Comments

@prodemmi

Hi, when I try to install dlib with pip, I got an error in the gcc version, but the latest gcc version is installed.

Expected Behavior

Since cmake and gcc are installed, the dlib package must be installed properly.

Current Behavior

Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 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
╰─> [77 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
Building extension for Python 3.8.12 (default, Jun 6 2022, 21:30:31)
Invoking CMake setup: ‘cmake /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8 -DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python -DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is GNU 4.8.5
— The CXX compiler identification is GNU 4.8.5
— Detecting C compiler ABI info
— Detecting C compiler ABI info — done
— Check for working C compiler: /usr/bin/cc — skipped
— Detecting C compile features
— Detecting C compile features — done
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Found PythonInterp: /home/axsut/DFDNet/DFDNet/env/bin/python (found version «3.8.12»)
— Found PythonLibs: /usr/local/lib/libpython3.8.a
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG — Failed
— Performing Test HAS_CPP11_FLAG
— Performing Test HAS_CPP11_FLAG — Success
— pybind11 v2.2.4
— Using CMake version: 3.22.4
— Compiling dlib version: 19.24.0
CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:50 (message):
C++11 is required to use dlib, but the version of GCC you are using is too
old and doesn’t support C++11. You need GCC 4.9 or newer.
Call Stack (most recent call first):
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8 (include)

  CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/check_if_sse4_instructions_executable_on_host.cmake:13 (try_compile):
    Failed to configure test project build system.
  Call Stack (most recent call first):
    /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:13 (include)
    /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/CMakeLists.txt:33 (include)
  
  
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log".
  See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeError.log".
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 222, in <module>
      setup(
    File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 134, in run
      self.build_extension(ext)
    File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 171, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python', '-DCMAKE_BUILD_TYPE=Release']' 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
╰─> [79 lines of output]
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.12 (default, Jun 6 2022, 21:30:31)
Invoking CMake setup: ‘cmake /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8 -DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python -DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is GNU 4.8.5
— The CXX compiler identification is GNU 4.8.5
— Detecting C compiler ABI info
— Detecting C compiler ABI info — done
— Check for working C compiler: /usr/bin/cc — skipped
— Detecting C compile features
— Detecting C compile features — done
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Found PythonInterp: /home/axsut/DFDNet/DFDNet/env/bin/python (found version «3.8.12»)
— Found PythonLibs: /usr/local/lib/libpython3.8.a
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG — Failed
— Performing Test HAS_CPP11_FLAG
— Performing Test HAS_CPP11_FLAG — Success
— pybind11 v2.2.4
— Using CMake version: 3.22.4
— Compiling dlib version: 19.24.0
CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:50 (message):
C++11 is required to use dlib, but the version of GCC you are using is too
old and doesn’t support C++11. You need GCC 4.9 or newer.
Call Stack (most recent call first):
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8 (include)

  CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/check_if_sse4_instructions_executable_on_host.cmake:13 (try_compile):
    Failed to configure test project build system.
  Call Stack (most recent call first):
    /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:13 (include)
    /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/CMakeLists.txt:33 (include)
  
  
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log".
  See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeError.log".
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 222, in <module>
      setup(
    File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
      return orig.install.run(self)
    File "/usr/local/lib/python3.8/distutils/command/install.py", line 545, in run
      self.run_command('build')
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 134, in run
      self.build_extension(ext)
    File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 171, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python', '-DCMAKE_BUILD_TYPE=Release']' 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.

Steps to Reproduce

pip install dlib

Platform: Centos 7.9.2009
Cmake version: 3.22.4
GCC verrsion: 9.2.0

@davisking

Not sure what to say. The output you pasted says you are using GNU 4.8.5,
which is super old.

On Wed, Jun 8, 2022 at 6:30 AM Emad Malekpour ***@***.***> wrote:
Hi, when I try to install dlib with a pipe, I got an error in the gcc
version, but the latest gcc version is installed.
Expected Behavior

Since cmake and gcc are installed, the dlib package must be installed
properly.
Current Behavior

Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 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
╰─> [77 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
Building extension for Python 3.8.12 (default, Jun 6 2022, 21:30:31)
Invoking CMake setup: ‘cmake
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8
-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python
-DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is GNU 4.8.5
— The CXX compiler identification is GNU 4.8.5
— Detecting C compiler ABI info
— Detecting C compiler ABI info — done
— Check for working C compiler: /usr/bin/cc — skipped
— Detecting C compile features
— Detecting C compile features — done
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Found PythonInterp: /home/axsut/DFDNet/DFDNet/env/bin/python (found
version «3.8.12»)
— Found PythonLibs: /usr/local/lib/libpython3.8.a
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG — Failed
— Performing Test HAS_CPP11_FLAG
— Performing Test HAS_CPP11_FLAG — Success
— pybind11 v2.2.4
— Using CMake version: 3.22.4
— Compiling dlib version: 19.24.0
CMake Error at
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:50
(message):
C++11 is required to use dlib, but the version of GCC you are using is too
old and doesn’t support C++11. You need GCC 4.9 or newer.
Call Stack (most recent call first):
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8
(include)

CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/check_if_sse4_instructions_executable_on_host.cmake:13 (try_compile):

Failed to configure test project build system.

Call Stack (most recent call first):

/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:13 (include)

/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/CMakeLists.txt:33 (include)

— Configuring incomplete, errors occurred!

See also «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log».

See also «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeError.log».

Traceback (most recent call last):

File «<string>», line 2, in <module>

File «<pip-setuptools-caller>», line 34, in <module>

File «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py», line 222, in <module>

setup(

File «/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/__init__.py», line 153, in setup

return distutils.core.setup(**attrs)

File «/usr/local/lib/python3.8/distutils/core.py», line 148, in setup

dist.run_commands()

File «/usr/local/lib/python3.8/distutils/dist.py», line 966, in run_commands

self.run_command(cmd)

File «/usr/local/lib/python3.8/distutils/dist.py», line 985, in run_command

cmd_obj.run()

File «/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/wheel/bdist_wheel.py», line 299, in run

self.run_command(‘build’)

File «/usr/local/lib/python3.8/distutils/cmd.py», line 313, in run_command

self.distribution.run_command(command)

File «/usr/local/lib/python3.8/distutils/dist.py», line 985, in run_command

cmd_obj.run()

File «/usr/local/lib/python3.8/distutils/command/build.py», line 135, in run

self.run_command(cmd_name)

File «/usr/local/lib/python3.8/distutils/cmd.py», line 313, in run_command

self.distribution.run_command(command)

File «/usr/local/lib/python3.8/distutils/dist.py», line 985, in run_command

cmd_obj.run()

File «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py», line 134, in run

self.build_extension(ext)

File «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py», line 171, in build_extension

subprocess.check_call(cmake_setup, cwd=build_folder)

File «/usr/local/lib/python3.8/subprocess.py», line 364, in check_call

raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command ‘[‘cmake’, ‘/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8’, ‘-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python’, ‘-DCMAKE_BUILD_TYPE=Release’]’ 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
╰─> [79 lines of output]
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.12 (default, Jun 6 2022, 21:30:31)
Invoking CMake setup: ‘cmake
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8
-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python
-DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is GNU 4.8.5
— The CXX compiler identification is GNU 4.8.5
— Detecting C compiler ABI info
— Detecting C compiler ABI info — done
— Check for working C compiler: /usr/bin/cc — skipped
— Detecting C compile features
— Detecting C compile features — done
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Found PythonInterp: /home/axsut/DFDNet/DFDNet/env/bin/python (found
version «3.8.12»)
— Found PythonLibs: /usr/local/lib/libpython3.8.a
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG — Failed
— Performing Test HAS_CPP11_FLAG
— Performing Test HAS_CPP11_FLAG — Success
— pybind11 v2.2.4
— Using CMake version: 3.22.4
— Compiling dlib version: 19.24.0
CMake Error at
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:50
(message):
C++11 is required to use dlib, but the version of GCC you are using is too
old and doesn’t support C++11. You need GCC 4.9 or newer.
Call Stack (most recent call first):
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8
(include)

CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/check_if_sse4_instructions_executable_on_host.cmake:13 (try_compile):

Failed to configure test project build system.

Call Stack (most recent call first):

/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:13 (include)

/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/CMakeLists.txt:33 (include)

— Configuring incomplete, errors occurred!

See also «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log».

See also «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeError.log».

Traceback (most recent call last):

File «<string>», line 2, in <module>

File «<pip-setuptools-caller>», line 34, in <module>

File «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py», line 222, in <module>

setup(

File «/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/__init__.py», line 153, in setup

return distutils.core.setup(**attrs)

File «/usr/local/lib/python3.8/distutils/core.py», line 148, in setup

dist.run_commands()

File «/usr/local/lib/python3.8/distutils/dist.py», line 966, in run_commands

self.run_command(cmd)

File «/usr/local/lib/python3.8/distutils/dist.py», line 985, in run_command

cmd_obj.run()

File «/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/command/install.py», line 61, in run

return orig.install.run(self)

File «/usr/local/lib/python3.8/distutils/command/install.py», line 545, in run

self.run_command(‘build’)

File «/usr/local/lib/python3.8/distutils/cmd.py», line 313, in run_command

self.distribution.run_command(command)

File «/usr/local/lib/python3.8/distutils/dist.py», line 985, in run_command

cmd_obj.run()

File «/usr/local/lib/python3.8/distutils/command/build.py», line 135, in run

self.run_command(cmd_name)

File «/usr/local/lib/python3.8/distutils/cmd.py», line 313, in run_command

self.distribution.run_command(command)

File «/usr/local/lib/python3.8/distutils/dist.py», line 985, in run_command

cmd_obj.run()

File «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py», line 134, in run

self.build_extension(ext)

File «/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py», line 171, in build_extension

subprocess.check_call(cmake_setup, cwd=build_folder)

File «/usr/local/lib/python3.8/subprocess.py», line 364, in check_call

raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command ‘[‘cmake’, ‘/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8’, ‘-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python’, ‘-DCMAKE_BUILD_TYPE=Release’]’ 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.
Steps to Reproduce

pip install dlib

Platform: Centos 7.9.2009
Cmake version: 3.22.4
GCC verrsion: 9.2.0


Reply to this email directly, view it on GitHub
<#2596>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPYFRZXKAKPH7KGC3G4EQ3VOBY3XANCNFSM5YGAUTAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>

@davisking

Like what does g++ --version say when you type it in a terminal?

@prodemmi

Like what does g++ --version say when you type it in a terminal?

This is the output:
[root@server ~]# g++ —version
g++ (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@davisking

🤷 the build output you pasted said it was using the old version.

@dlib-issue-bot

Warning: this issue has been inactive for 35 days and will be automatically closed on 2022-07-24 if there is no further activity.

If you are waiting for a response but haven’t received one it’s possible your question is somehow inappropriate. E.g. it is off topic, you didn’t follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib’s official compilation instructions, dlib’s API documentation, or a Google search.

@Naresh1436

Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py): started
Building wheel for dlib (setup.py): finished with status ‘error’
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status ‘error’

error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [10 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)
warning: build_py: byte-compiling is disabled, skipping.

  running build_ext
  
  ERROR: CMake must be installed to build dlib
  
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for dlib
error: subprocess-exited-with-error

× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running install
/usr/lib/python3/dist-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)
warning: build_py: byte-compiling is disabled, skipping.

  running build_ext
  
  ERROR: CMake must be installed to build dlib
  
  [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.

@davisking

ERROR: CMake must be installed to build dlib.

You have to install CMake :) Get it from cmake.org.

@vaxobovavazbek

Collecting dlib==19.4
Downloading dlib-19.4.0.tar.gz (4.0 MB)
—————————————- 4.0/4.0 MB 595.8 kB/s eta 0:00:00
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
╰─> [39 lines of output]
running bdist_wheel
running build
Detected Python architecture: 64bit
Detected platform: win32
Configuring cmake …
C:Program FilesPython310libsubprocess.py:959: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
Traceback (most recent call last):
File «», line 2, in
File «», line 34, in
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 607, in
setup(
File «C:Program FilesPython310libsite-packagessetuptools_init_.py», line 87, in setup
return distutils.core.setup(**attrs)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscore.py», line 177, in setup
return run_commands(dist)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscore.py», line 193, in run_commands
dist.run_commands()
File «C:Program FilesPython310libsite-packagessetuptools_distutilsdist.py», line 968, in run_commands
self.run_command(cmd)
File «C:Program FilesPython310libsite-packagessetuptoolsdist.py», line 1217, in run_command
super().run_command(command)
File «C:Program FilesPython310libsite-packagessetuptools_distutilsdist.py», line 987, in run_command
cmd_obj.run()
File «C:Program FilesPython310libsite-packageswheelbdist_wheel.py», line 325, in run
self.run_command(«build»)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscmd.py», line 317, in run_command
self.distribution.run_command(command)
File «C:Program FilesPython310libsite-packagessetuptoolsdist.py», line 1217, in run_command
super().run_command(command)
File «C:Program FilesPython310libsite-packagessetuptools_distutilsdist.py», line 987, in run_command
cmd_obj.run()
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 405, in run
self.build_dlib()
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 558, in build_dlib
if run_process(cmake_cmd):
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 298, in run_process
while t.isAlive():
AttributeError: ‘Thread’ object has no attribute ‘isAlive’. Did you mean: ‘is_alive’?
[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
╰─> [44 lines of output]
running install
C:Program FilesPython310libsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
Detected Python architecture: 64bit
Detected platform: win32
Removing build directory C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254./tools/python/build
Configuring cmake …
C:Program FilesPython310libsubprocess.py:959: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
Traceback (most recent call last):
File «», line 2, in
File «», line 34, in
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 607, in
setup(
File «C:Program FilesPython310libsite-packagessetuptools_init_.py», line 87, in setup
return distutils.core.setup(**attrs)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscore.py», line 177, in setup
return run_commands(dist)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscore.py», line 193, in run_commands
dist.run_commands()
File «C:Program FilesPython310libsite-packagessetuptools_distutilsdist.py», line 968, in run_commands
self.run_command(cmd)
File «C:Program FilesPython310libsite-packagessetuptoolsdist.py», line 1217, in run_command
super().run_command(command)
File «C:Program FilesPython310libsite-packagessetuptools_distutilsdist.py», line 987, in run_command
cmd_obj.run()
File «C:Program FilesPython310libsite-packagessetuptoolscommandinstall.py», line 68, in run
return orig.install.run(self)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscommandinstall.py», line 695, in run
self.run_command(‘build’)
File «C:Program FilesPython310libsite-packagessetuptools_distutilscmd.py», line 317, in run_command
self.distribution.run_command(command)
File «C:Program FilesPython310libsite-packagessetuptoolsdist.py», line 1217, in run_command
super().run_command(command)
File «C:Program FilesPython310libsite-packagessetuptools_distutilsdist.py», line 987, in run_command
cmd_obj.run()
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 405, in run
self.build_dlib()
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 558, in build_dlib
if run_process(cmake_cmd):
File «C:UsersHPAppDataLocalTemppip-install-c08tomm3dlib_e9ee89625c5f489db3a055aad39ae254setup.py», line 298, in run_process
while t.isAlive():
AttributeError: ‘Thread’ object has no attribute ‘isAlive’. Did you mean: ‘is_alive’?
[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./

I have amd rayzen 5 4500U CPU. I cannot install dlib why?
I installed Cmake. Cant fix

@davisking

dlib 19.4 is super old. Use the current version :)

@rafi-am7

ERROR: CMake must be installed to build dlib.

You have to install CMake :) Get it from cmake.org.

This helped me. Thanks

@wpmanoj

select 14 instead 11

g++ -std=c++14 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 example.cpp

Содержание

  1. Package failed to install error while installing package
  2. Check if your Python version is supported by the package #
  3. Create a virtual environment #
  4. Try running pip install in verbose mode #
  5. Conclusion #
  6. Encountered error while trying to install package
  7. Error while installing packages
  8. Как исправить ошибку Encountered error while trying to install package
  9. Что это за ошибка
  10. Как исправить
  11. How To Solve Error: legacy-install-failure?
  12. Solve error: legacy-install-failure For Gensim
  13. Solve error: legacy-install-failure In Pandas
  14. Solve error: legacy-install-failure For Basemap
  15. Solving For Windows Operating System
  16. Solving For MAC Operating System
  17. Solving For Google Colab
  18. Solve error: legacy-install-failure For MySQL
  19. Solve error: legacy-install-failure For Wxpython
  20. Solve error: legacy-install-failure For Psycopg2-binary
  21. Solve Error legacy-install-failure For Cffi
  22. Solve error: legacy-install-failure For Dlib
  23. Solve Error legacy-install-failure For Fbprophet
  24. Solve error: legacy-install-failure For Horovod
  25. FAQs on Error: legacy-install-failure
  26. Conclusion

Package failed to install error while installing package

Once you open the file, open your shell in the directory where the file is located (e.g. C:UsersExampleDownloads ) and install it using pip :

  1. Open the directory that contains the file in Explorer.
  2. Press Shift and right-click in Explorer.
  1. Click on «Open PowerShell window here».
  2. Run the following command.

Make sure to specify the name of the .whl file correctly as your Python version and the name of the package will likely be different.

If that didn’t help and your error message contains something like: «error: Microsoft Visual C++ 14.0 or greater is required. Get it with «Microsoft C++ Build Tools»: https://visualstudio.microsoft.com/visual-cpp-build-tools/», download Microsoft Build tools and check the «Desktop development with C++ checkbox when installing.

Check if your Python version is supported by the package #

The «error: legacy-install-failure» is sometimes caused when the package you are trying to install doesn’t have available wheels for your version of Python.

You can check your Python version with the python —version command.

You can check if a package has wheels available for a specific Python version in the Download files section of the package’s pypi page.

If the .whl files are not available for your version of Python, you can download an older version.

You can download a specific Python version that is supported by the package if the package doesn’t support the latest Python version.

Different versions are available in the «Looking for a specific release» table.

Make sure to tick the following options if you get prompted:

  • Install launcher for all users (recommended)
  • Add Python to PATH (this adds Python to your PATH environment variable)

Create a virtual environment #

To solve the «error: legacy-install-failure»:

  1. Create a virtual environment.
  2. Activate the virtual environment.
  3. Run the pip install command with the virtual environment active.

If the python3 -m venv venv command doesn’t work, try the following 2 commands:

  • python -m venv venv
  • py -m venv venv

Make sure to use the correct command to activate your virtual environment depending on your operating system and your shell.

Your virtual environment will use the version of Python that was used to create it.

Try running pip install in verbose mode #

If none of the suggestions helped, try running the pip install command in verbose mode.

The -v option stands for verbose mode and can be used up to 3 times.

When the pip install command is run in verbose mode, the command shows more output and how the error occurred.

Conclusion #

To solve the «Error: legacy-install-failure»:

  1. Upgrade your versions of pip , setuptools and wheel before running pip install .
  2. Check if your Python version is supported by the package.
  3. On Windows, download and install the package from unofficial binaries.
  4. Try to install the package with the —pre option.

Источник

Encountered error while trying to install package

28.07.2022 698 Просмотры

Я хочу установить пакет gensim python через pip install gensim.

Но возникает эта ошибка, и я не знаю, что мне делать, чтобы решить ее.

Если вам не удалось установить плагины,
вы можете скачать его из других репозиториев, например, из этого: репозиторий зависит от версии python и системы.

например: для windows 11(x64) и python 3.10 вы должны взять этот файл: gensim-4.1.2-cp310-cp310-win_amd64.whl

Error while installing packages

Я использую Ubuntu 12.04. Я столкнулся с ошибкой при установке любого пакета с помощью apt-get. Я пробовал шаги, приведенные на различных форумах, но не смог решить проблему. Например, если я устанавливаю kcachegrind, код ошибки следующий:

[Я заменил http:// на http// только для того, чтобы избежать ссылок при размещении вопроса. Поэтому, пожалуйста, читайте http// как http:// в сегментах кода].

Попробуйте выполнить следующие команды,

sudo dpkg -P mysql-client-5.1
sudo apt-get install -f

В ошибке написано что для компиляции пакета нужно установить Microsoft C++ Build Tools версии 14.2 или выше, а также приведена ссылка где их можно скачать: https://visualstudio.microsoft.com/visual-cpp-build-tools/.

Hi,
pip install sentencepiece fails,
This is the log I get:

pip install sentencepiece
7.4.0
Collecting sentencepiece
Using cached https://files.pythonhosted.org/packages/fd/45/6d0eb609d5cd81df094aab71a867b2ab6b315ffd592e78fb94a625c4d6aa/sentencepiece-0.1.3.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: /bin/sh: 1: pkg-config: not found
Failed to find sentencepiece pkgconfig
—————————————-
ERROR: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-463tj_x8/sentencepiece/

Same here, only happens on Python 3.7.4 for me, works on Python 3.6. Observed on Ubuntu 16.04.4

Источник

Как исправить ошибку Encountered error while trying to install package

Мир программирования полон испытаний, которые нередко пугают новичков. Вне зависимости от своего стажа, программисты сталкиваются с различными багами, глюками, сбоями и прочими ошибками, на исправление которых может уйти как несколько минут, так и целый день. Например, Python-разработчики часто сталкиваются с ошибкой «Encountered error while trying to install package». Расскажем о том, что это за ошибка и что делать при ее возникновении.

Что это за ошибка

Вообще, чаще всего пользователи читают только половину вывода интерпретатора (а порой и вовсе только ее название), не обращая внимания на ее описание и результаты трассировки, которые указаны выше. Для того чтобы разобраться в проблеме, попробуем дословно перевести ее на русский.

«Обнаружена ошибка при попытке установить пакет» – именно так звучит ошибка. Она возникает только в тех случаях, когда пользователь хочет установить сторонний пакет Python с помощью пакетного менеджера Pip. Чаще всего проблема связана с нехваткой необходимого модуля или пакета. Название отсутствующего компонента указывается в результатах трассировки.

Как исправить

Многие устанавливаемые пакеты зависят от служебного компонента, который называется «Microsoft C++ Build Tools» (инструменты сборки Microsoft C++). В первую очередь попробуйте установить его. Алгоритм действий:

  • Нажмите на кнопку «Загрузить Build Tools».

  • Дождитесь завершения загрузки и запустите установщик.
  • Укажите путь для сохранения компонента.

  • Дождитесь завершения установки.

После этих махинаций снова попробуйте установить проблемный компонент. Если ничего не получилось, то значит проблема в нехватке другого компонента. Внимательно ознакомьтесь с выводом интерпретатора, в котором будет указан недостающий файл.

Источник

How To Solve Error: legacy-install-failure?

Python provides you with a package installer called ‘pip.’ ‘Pip’ allows you to write a line of code to install packages and manage them. Although sometimes, when you are installing some packages, you might get an ‘error: legacy-install-failure.’ For example, if you are trying to install the gensim package in python. To know more about ‘pip’ check out this post.

Solving ‘ Error: legacy-install-failure’

In this article, we will discuss how we can solve this error.

Solve error: legacy-install-failure For Gensim

Pip is a package installer and manager, and the wheel is a way that pip prefers to install packages because the wheel allows fast and efficient installations and are smaller in comparison to eggs. Hence upgrading wheels might also solve the problem of ‘error: legacy-install-failure.’ The setuptools enhance the over-installation by enhancing the python standard library distribution utilities. Therefore if you update these modules, it might solve your error because this error can also arise if one of these modules is not up-to-date. Let us see how we can upgrade these modules.

  • First, update your pip installer as shown below.
  • Then upgrade your wheel by using:
  • Then finally upgrade the setuptools.
  • And then again try to install the package which was throwing error in the first place.

Solve error: legacy-install-failure In Pandas

Pandas is an open-source library in python which allows users to perform high-level data manipulation. It is one of the most important libraries in python in the sense of data structure programming and data analysis because it provides flexible, fast and expressive data structures. However, sometimes when you try to install this library using pip, you can get an ‘error: legacy-install-failure,’ which can prevent us from using this very important library. Let us see how we can solve this error in python.

To solve this problem, you need to install ‘pipwin’ because it may happen that the ‘pandas’ wheel might not support the python version you are working on; therefore, first, install ‘pipwin’.

And further, when you install ‘pipwin,’ install ‘pandas’ using ‘pipwin.’

This should probably solve the ‘error: legacy-install-failure’ and allow you to install the pandas library and use it.

Solve error: legacy-install-failure For Basemap

Basemap is a tool in python that provides you to create maps in a very easy and simple way. It is an extension of the ‘ matplotlib ‘ library; therefore, it contains all the features for carrying out data visualization. It further adds geographical projections and some other additional data sets in order to enable plotting coastlines, countries, states, boundaries and etc., directly from the library. Similarly, when you try to install this library through ‘pip,’ you might face a Solve ‘ error: legacy-install-failure’. We will discuss how we can solve this error for the basemap library.

Solving For Windows Operating System

If you are using Windows operating system and encounter this error you need to follow some steps. The steps are as given below:

gohlke/pythonlibs/#basemap

  • You will be directed to the file directory. If you’re using python 3.10.x, download the file named ‘basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
  • Now go to this wheel file and run the following command:
  • Doing this should solve the ‘error: legacy-install-failure’ error.

    Solving For MAC Operating System

    If you are using MAC Operating System and encounter this error, you need to follow some steps. The steps are as given below:

    • First, make sure you install all the packages as shown below:
    • Then you have to add GEOS_DIR = “/ user / local / Cellar / geos / 3.10.2 /” to your .bash profile and reload it via: source

    /.bash_profile. You can do that by :

    • Further, go to the basemap directory from the path: basemap/packages/ basemap. And finally, run the install code from that directory.

    This should solve the ‘error: legacy-install-failure’ error.

    Solving For Google Colab

    To solve this error in google colab, you need to run the commands given below, and doing that should solve the ‘error: legacy-install-failure’ error.

    Solve error: legacy-install-failure For MySQL

    MySQL provides services for handling and managing databases. When you connect your python application to an active server, you can manage all your database using MySQL. Although when installing using an ‘Error: legacy-install-failure’ error might occur. It can display something like this.

    To solve this following error, you will need to follow the steps given below:

    • First, run the commands given below
    • Further, make some changes in the settings file if you are using some framework like Django or any other. To make this change run these commands.

    Further, install all other dependencies in the env/lib/python3.8/site-packages/django/db/backends/mysql/base.py directory. These dependencies can be installed like:

    • Now try to install MySQL again, as following these steps should solve the error.

    Solve error: legacy-install-failure For Wxpython

    Wxpython is a cross-platform Graphical User Interface toolkit for python language. It enables the users to program independent and robust code, which provides a very high graphical user interface very easily and quite simply. This library, like many other libraries, is open source. Although sometimes, while installing ‘wxPython,’ you might face an ‘error: legacy-install-failure’ error.

    This error might occur because you might be using a python version that is not compatible with ‘wxPython.’ Therefore the easiest solution is to downgrade your python version to 3.9.13 because the last version of ‘wxPython’ came before python 3.10. There might be an alternative solution to this, but right now, this is the easiest solution.

    Solve error: legacy-install-failure For Psycopg2-binary

    To solve this error, you have to follow some steps. You can solve this problem by upgrading some packages.

    This code will upgrade some outdated packages and might solve the problem.

    Solve Error legacy-install-failure For Cffi

    When you are programming on Django, you might get an error while installing libraries. You can solve this error by the following code.

    Solve error: legacy-install-failure For Dlib

    You can also get an error while installing the ‘dlib’ library through pip. To solve this error, try to install the library from scratch by following the steps.

    • First, install ‘anaconda.’
    • Further activate the virtual environment through a command prompt.
    • Install ‘opencv’ using pip.
    • Install ‘dlib’ using pip.

    This will eventually solve your error.

    Solve Error legacy-install-failure For Fbprophet

    You can encounter an error while installing Facebook prophet using pip. This error occurs because you might not have installed dependencies for the wheel to be installed. You can solve this error by installing all the dependencies and then installing the ‘fbprophet’ using pip.

    Solve error: legacy-install-failure For Horovod

    When you are trying to install ‘horvord’ with ‘PyTorch,’ you might encounter an error of sort ‘error: legacy-install-failure’.

    This error occurs because an older version of ‘horovord’ than 0.24.0 is not compatible with PyTorch. Therefore you can solve this error by upgrading ‘horovord’ to newer versions.

    FAQs on Error: legacy-install-failure

    There are many ways you can solve this error, and we have discussed some of them in this article. You can follow those solutions to solve this error depending upon the library you want to install.

    You can upgrade setuptool with pip using the following command:
    pip install — upgrade setuptools

    You can pip install pandas from PyPI.

    Conclusion

    Finally conclude, we can say that we have discussed various methods in this article to solve the ‘error: legacy-install-failure’ error which occurs for different libraries and modules. You can use any of the methods according to your requirements and according to the library or modules, you want to install for your program.

    Источник

    Хотел установить библиотеки: cmake, dlib, face-recognition, и у меня они при установке выдают ошибку:

    (venv) C:UsersigotgPycharmProjectspythonProject>pip install dlib
    Collecting dlib
      Using cached dlib-19.24.0.tar.gz (3.2 MB)
      Preparing metadata (setup.py) ... done
    Building wheels for collected packages: dlib
      Building wheel for dlib (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: 'C:UsersigotgPycharmProjectspythonProjectvenvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\igotg\AppData\Local\Temp\pip-install-_f13hztz\dlib_95024e1ac1cd4e
    668178db4bed7fccf0\setup.py'"'"'; __file__='"'"'C:\Users\igotg\AppData\Local\Temp\pip-install-_f13hztz\dlib_95024e1ac1cd4e668178db4bed7fccf0\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
    sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersigotgAppDataLocalTemppip-wheel-1c482bbx'
           cwd: C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0
      Complete output (62 lines):
      running bdist_wheel
      running build
      running build_py
      package init file 'toolspythondlib__init__.py' not found (or not a regular file)
      running build_ext
      C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0toolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95
    024e1ac1cd4e668178db4bed7fccf0buildlib.win-amd64-3.8 -DPYTHON_EXECUTABLE=C:UsersigotgPycharmProjectspythonProjectvenvScriptspython.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0buildlib.win-amd64-3.8 -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 1, in <module>
        File "C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0setup.py", line 222, in <module>
          setup(
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools__init__.py", line 155, in setup
          return distutils.core.setup(**attrs)
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilscore.py", line 148, in setup
          return run_commands(dist)
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilscore.py", line 163, in run_commands
          dist.run_commands()
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilsdist.py", line 967, in run_commands
          self.run_command(cmd)
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilsdist.py", line 986, in run_command
          cmd_obj.run()
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packageswheelbdist_wheel.py", line 299, in run
          self.run_command('build')
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilscmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilsdist.py", line 986, in run_command
          cmd_obj.run()
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilscommandbuild.py", line 135, in run
          self.run_command(cmd_name)
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilscmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:UsersigotgPycharmProjectspythonProjectvenvlibsite-packagessetuptools_distutilsdist.py", line 986, in run_command
          cmd_obj.run()
        File "C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0setup.py", line 134, in run
          self.build_extension(ext)
        File "C:UsersigotgAppDataLocalTemppip-install-_f13hztzdlib_95024e1ac1cd4e668178db4bed7fccf0setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "C:UsersigotgAppDataLocalProgramsPythonPython38libsubprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\Users\igotg\AppData\Local\Temp\pip-install-_f13hztz\dlib_95024e1ac1cd4e668178db4bed7fccf0\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\igotg\AppData\L
    ocal\Temp\pip-install-_f13hztz\dlib_95024e1ac1cd4e668178db4bed7fccf0\build\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=C:\Users\igotg\PycharmProjects\pythonProject\venv\Scripts\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\igotg\AppData\Local\Temp\pip-install-_f13hztz\dlib_95024e1ac1cd4e668178db4bed7fccf0\build\lib.win-amd64-3.8', '-A', 'x64']' returned non-zero exit status 1.
      ----------------------------------------
      ERROR: Failed building wheel for dlib

    В чем может быть проблема? Уже пытался переустанавливать версии питона(сейчас 3.8.0)
    + меня установлен VS2022 с C++ пакетами

    Python provides you with a package installer called ‘pip.’ ‘Pip’ allows you to write a line of code to install packages and manage them. Although sometimes, when you are installing some packages, you might get an ‘error: legacy-install-failure.’ For example, if you are trying to install the gensim package in python. To know more about ‘pip’ check out this post.

    How To Solve Error: legacy-install-failure?

    Solving ‘ Error: legacy-install-failure’

    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.
    ╰─> gensim
    

    In this article, we will discuss how we can solve this error.

    Pip is a package installer and manager, and the wheel is a way that pip prefers to install packages because the wheel allows fast and efficient installations and are smaller in comparison to eggs. Hence upgrading wheels might also solve the problem of ‘error: legacy-install-failure.’ The setuptools enhance the over-installation by enhancing the python standard library distribution utilities. Therefore if you update these modules, it might solve your error because this error can also arise if one of these modules is not up-to-date. Let us see how we can upgrade these modules.

    • First, update your pip installer as shown below.
    python - m pip install – upgrade pip
    
    • Then upgrade your wheel by using:
    pip install - upgrade wheel
    
    • Then finally upgrade the setuptools.
    pip install - upgrade setuptools
    
    • And then again try to install the package which was throwing error in the first place.

    Solve error: legacy-install-failure In Pandas

    Pandas is an open-source library in python which allows users to perform high-level data manipulation. It is one of the most important libraries in python in the sense of data structure programming and data analysis because it provides flexible, fast and expressive data structures. However, sometimes when you try to install this library using pip, you can get an ‘error: legacy-install-failure,’ which can prevent us from using this very important library. Let us see how we can solve this error in python.

    To solve this problem, you need to install ‘pipwin’ because it may happen that the ‘pandas’ wheel might not support the python version you are working on; therefore, first, install ‘pipwin’.

    And further, when you install ‘pipwin,’ install ‘pandas’ using ‘pipwin.’

    This should probably solve the ‘error: legacy-install-failure’ and allow you to install the pandas library and use it.

    Solve error: legacy-install-failure For Basemap

    Basemap is a tool in python that provides you to create maps in a very easy and simple way. It is an extension of the ‘matplotlib‘ library; therefore, it contains all the features for carrying out data visualization. It further adds geographical projections and some other additional data sets in order to enable plotting coastlines, countries, states, boundaries and etc., directly from the library. Similarly, when you try to install this library through ‘pip,’ you might face a Solve ‘ error: legacy-install-failure’. We will discuss how we can solve this error for the basemap library.

    Solving For Windows Operating System

    If you are using Windows operating system and encounter this error you need to follow some steps. The steps are as given below:

    • First, go this path https://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
    • You will be directed to the file directory. If you’re using python 3.10.x, download the file named ‘basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
    • Now go to this wheel file and run the following command:
    pip install basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
    

    Doing this should solve the ‘error: legacy-install-failure’ error.

    Solving For MAC Operating System

    If you are using MAC Operating System and encounter this error, you need to follow some steps. The steps are as given below:

    • First, make sure you install all the packages as shown below:
    brew install geos
    brew install matplotlib
    brew install numpy
    brew install proj
    
    • Then you have to add GEOS_DIR = “/ user / local / Cellar / geos / 3.10.2 /” to your .bash profile and reload it via: source ~/.bash_profile. You can do that by :
    git clone --depth 1 https://github.com/matplotlib/basemap.git
    
    • Further, go to the basemap directory from the path: basemap/packages/ basemap. And finally, run the install code from that directory.

    This should solve the ‘error: legacy-install-failure’ error.

    Solving For Google Colab

    To solve this error in google colab, you need to run the commands given below, and doing that should solve the ‘error: legacy-install-failure’ error.

    !sudo apt-get install libgeos-3.6.2
    !sudo apt-get install libgeos-dev
    !pip install git+https://github.com/matplotlib/basemap#subdirectory=packages/basemap
    

    Solve error: legacy-install-failure For MySQL

    MySQL provides services for handling and managing databases. When you connect your python application to an active server, you can manage all your database using MySQL. Although when installing using an ‘Error: legacy-install-failure’ error might occur. It can display something like this.

      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.
    ╰─> mysqlclient
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.
    

    To solve this following error, you will need to follow the steps given below:

    • First, run the commands given below
    xcode-select --install
    brew install zstd
    pip install pymysql
    pip install wheel 
    CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install mysqlclient==<version>
    
    • Further, make some changes in the settings file if you are using some framework like Django or any other. To make this change run these commands.
    import pymysql
    pymysql.install_as_MySQLdb()
    

    Further, install all other dependencies in the env/lib/python3.8/site-packages/django/db/backends/mysql/base.py directory. These dependencies can be installed like:

    pip install mysql-connector-python
    pip install cryptography
    
    • Now try to install MySQL again, as following these steps should solve the error.

    Solve error: legacy-install-failure For Wxpython

    Wxpython is a cross-platform Graphical User Interface toolkit for python language. It enables the users to program independent and robust code, which provides a very high graphical user interface very easily and quite simply. This library, like many other libraries, is open source. Although sometimes, while installing ‘wxPython,’ you might face an ‘error: legacy-install-failure’ error.

      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.
    ╰─> wxPython
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.
    

    This error might occur because you might be using a python version that is not compatible with ‘wxPython.’ Therefore the easiest solution is to downgrade your python version to 3.9.13 because the last version of ‘wxPython’ came before python 3.10. There might be an alternative solution to this, but right now, this is the easiest solution.

    Solve error: legacy-install-failure For Psycopg2-binary

    To solve this error, you have to follow some steps. You can solve this problem by upgrading some packages.

    pip uninstall psycopg2
    pip list --outdated
    pip install --upgrade wheel
    pip install --upgrade setuptools
    pip install psycopg2
    

    This code will upgrade some outdated packages and might solve the problem.

    Solve Error legacy-install-failure For Cffi

    When you are programming on Django, you might get an error while installing libraries. You can solve this error by the following code.

    RUN python -m venv /py && 
       /py/bin/pip install --upgrade pip && 
       apk add --update alpine-sdk && 
       apk add --update --no-cache postgresql-client && 
       apk add --update --no-cache --virtual .tmp-build-deps 
          build-base gcc python3-dev postgresql-dev musl-dev libffi-dev openssl-dev cargo  && 
       /py/bin/pip install -r /tmp/requirements.txt && 
       if [ $DEV = "true" ]; 
          then /py/bin/pip install -r /tmp/requirements.dev.txt ; 
       fi && 
       rm -rf /tmp && 
       apk del .tmp-build-deps && 
       adduser 
          --disabled-password 
          --no-create-home 
          django-user
    

    Solve error: legacy-install-failure For Dlib

    You can also get an error while installing the ‘dlib’ library through pip. To solve this error, try to install the library from scratch by following the steps.

    • First, install ‘anaconda.’
    • Further activate the virtual environment through a command prompt.
    • Install ‘opencv’ using pip.
    • Install ‘dlib’ using pip.

    This will eventually solve your error.

    Solve Error legacy-install-failure For Fbprophet

    You can encounter an error while installing Facebook prophet using pip. This error occurs because you might not have installed dependencies for the wheel to be installed. You can solve this error by installing all the dependencies and then installing the ‘fbprophet’ using pip.

    Solve error: legacy-install-failure For Horovod

    When you are trying to install ‘horvord’ with ‘PyTorch,’ you might encounter an error of sort ‘error: legacy-install-failure’.

      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.
    ╰─> horovod
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure. 
    

    This error occurs because an older version of ‘horovord’ than 0.24.0 is not compatible with PyTorch. Therefore you can solve this error by upgrading ‘horovord’ to newer versions.

    [Resolved] NameError: Name _mysql is Not Defined

    FAQs on Error: legacy-install-failure

    How can you solve ‘error: legacy-install-failure’?

    There are many ways you can solve this error, and we have discussed some of them in this article. You can follow those solutions to solve this error depending upon the library you want to install.

    How to upgrade setuptools with pip?

    You can upgrade setuptool with pip using the following command:
    pip install - upgrade setuptools

    Can you pip install pandas?

    You can pip install pandas from PyPI.

    Conclusion

    Finally conclude, we can say that we have discussed various methods in this article to solve the ‘error: legacy-install-failure’ error which occurs for different libraries and modules. You can use any of the methods according to your requirements and according to the library or modules, you want to install for your program.

    Trending Python Articles

    • “Other Commands Don’t Work After on_message” in Discord Bots

      “Other Commands Don’t Work After on_message” in Discord Bots

      February 5, 2023

    • Botocore.Exceptions.NoCredentialsError: Unable to Locate Credentials

      Botocore.Exceptions.NoCredentialsError: Unable to Locate Credentials

      by Rahul Kumar YadavFebruary 5, 2023

    • [Resolved] NameError: Name _mysql is Not Defined

      [Resolved] NameError: Name _mysql is Not Defined

      by Rahul Kumar YadavFebruary 5, 2023

    • Best Ways to Implement Regex New Line in Python

      Best Ways to Implement Regex New Line in Python

      by Rahul Kumar YadavFebruary 5, 2023

    I was trying to install dlib library for face recognition in pycharm,

    pip install dlib

    I’m using virtual environment and base interpreter is C:UsersAyushmanAppDataLocalProgramsPythonPython38-32python.exe

    Already installed cmake and pip.

    python—version 3.8.3

    pip—version 20.1.1

    When I tried to install from setting, I got this error message:

    Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:UsersAyushmanPycharmProjectsdemoProjectvenvScriptspython.exe'. 
    

    When I used terminal, I got this error message:

    Collecting dlib
      Using cached dlib-19.19.0.tar.gz (3.2 MB)
    Using legacy setup.py install for dlib, since package 'wheel' is not installed.
    Installing collected packages: dlib
        Running setup.py install for dlib ... error
        ERROR: Command errored out with exit status 1:
         command: 'c:usersayushmanpycharmprojectsdemoprojectvenvscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ayushman
    \AppData\Local\Temp\pip-install-7crglpz8\dlib\setup.py'"'"'; __file__='"'"'C:\Users\Ayushman\AppData\Local\Temp\pip-install-7crglpz8\dlib\setup.py'"'"'
    ;f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' ins
    tall --record 'C:UsersAyushmanAppDataLocalTemppip-record-id9u7hlkinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:users
    ayushmanpycharmprojectsdemoprojectvenvincludesitepython3.8dlib'
             cwd: C:UsersAyushmanAppDataLocalTemppip-install-7crglpz8dlib
        Complete output (80 lines):
        running install
        running build
        running build_py
        package init file 'dlib__init__.py' not found (or not a regular file)
        running build_ext
        Building extension for Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)]
        Invoking CMake setup: 'cmake C:UsersAyushmanAppDataLocalTemppip-install-7crglpz8dlibtoolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsersAyushmanAppDa
    taLocalTemppip-install-7crglpz8dlibbuildlib.win32-3.8 -DPYTHON_EXECUTABLE=c:usersayushmanpycharmprojectsdemoprojectvenvscriptspython.exe -DCMAKE_LIBRARY
    _OUTPUT_DIRECTORY_RELEASE=C:UsersAyushmanAppDataLocalTemppip-install-7crglpz8dlibbuildlib.win32-3.8'
        -- Building for: NMake Makefiles
        -- The C compiler identification is unknown
        -- The CXX compiler identification is unknown
        CMake Error at CMakeLists.txt:3 (project):
          The CMAKE_C_COMPILER:
        
            cl
        
          is not a full path and was not found in the PATH.
        
          To use the NMake generator with Visual C++, cmake must be run from a shell
          that can use the compiler cl from the command line.  This environment is
          unable to invoke the cl compiler.  To fix this problem, run cmake from the
          Visual Studio Command Prompt (vcvarsall.bat).
        
          Tell CMake where to find the compiler by setting either the environment
          variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
          the compiler, or to the compiler name if it is in the PATH.
        
        
        CMake Error at CMakeLists.txt:3 (project):
          The CMAKE_CXX_COMPILER:
        
            cl
        
          is not a full path and was not found in the PATH.
        
          To use the NMake generator with Visual C++, cmake must be run from a shell
          that can use the compiler cl from the command line.  This environment is
          unable to invoke the cl compiler.  To fix this problem, run cmake from the
          Visual Studio Command Prompt (vcvarsall.bat).
        
          Tell CMake where to find the compiler by setting either the environment
          variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
          to the compiler, or to the compiler name if it is in the PATH.
        
        
        -- Configuring incomplete, errors occurred!
        See also "C:/Users/Ayushman/AppData/Local/Temp/pip-install-7crglpz8/dlib/build/temp.win32-3.8/Release/CMakeFiles/CMakeOutput.log".
        See also "C:/Users/Ayushman/AppData/Local/Temp/pip-install-7crglpz8/dlib/build/temp.win32-3.8/Release/CMakeFiles/CMakeError.log".
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "C:UsersAyushmanAppDataLocalTemppip-install-7crglpz8dlibsetup.py", line 223, in <module>
            setup(
          File "c:usersayushmanpycharmprojectsdemoprojectvenvlibsite-packagessetuptools__init__.py", line 144, in setup
            return distutils.core.setup(**attrs)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilscore.py", line 148, in setup
            dist.run_commands()
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilsdist.py", line 966, in run_commands
            self.run_command(cmd)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilsdist.py", line 985, in run_command
            cmd_obj.run()
          File "c:usersayushmanpycharmprojectsdemoprojectvenvlibsite-packagessetuptoolscommandinstall.py", line 61, in run
            return orig.install.run(self)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilscommandinstall.py", line 545, in run
            self.run_command('build')
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilscmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilsdist.py", line 985, in run_command
            cmd_obj.run()
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilscommandbuild.py", line 135, in run
            self.run_command(cmd_name)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilscmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libdistutilsdist.py", line 985, in run_command
            cmd_obj.run()
          File "C:UsersAyushmanAppDataLocalTemppip-install-7crglpz8dlibsetup.py", line 135, in run
            self.build_extension(ext)
          File "C:UsersAyushmanAppDataLocalTemppip-install-7crglpz8dlibsetup.py", line 172, in build_extension
            subprocess.check_call(cmake_setup, cwd=build_folder)
          File "C:UsersAyushmanAppDataLocalProgramsPythonPython38-32libsubprocess.py", line 364, in check_call
            raise CalledProcessError(retcode, cmd)
        subprocess.CalledProcessError: Command '['cmake', 'C:\Users\Ayushman\AppData\Local\Temp\pip-install-7crglpz8\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT
    _DIRECTORY=C:\Users\Ayushman\AppData\Local\Temp\pip-install-7crglpz8\dlib\build\lib.win32-3.8', '-DPYTHON_EXECUTABLE=c:\users\ayushman\pycharmprojects\d
    emoproject\venv\scripts\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Ayushman\AppData\Local\Temp\pip-install-7crglpz8\dlib\build\lib.w
    in32-3.8']' returned non-zero exit status 1.
        ----------------------------------------
    ERROR: Command errored out with exit status 1: 'c:usersayushmanpycharmprojectsdemoprojectvenvscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.a
    rgv[0] = '"'"'C:\Users\Ayushman\AppData\Local\Temp\pip-install-7crglpz8\dlib\setup.py'"'"'; __file__='"'"'C:\Users\Ayushman\AppData\Local\Temp\pip-inst
    all-7crglpz8\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code
    , __file__, '"'"'exec'"'"'))' install --record 'C:UsersAyushmanAppDataLocalTemppip-record-id9u7hlkinstall-record.txt' --single-version-externally-managed --co
    mpile --install-headers 'c:usersayushmanpycharmprojectsdemoprojectvenvincludesitepython3.8dlib' Check the logs for full command output.
    

    Error in python3 PIP install Dlib:

    Dlib has been installed before. It takes a long time. When you re install it, you forget some necessary conditions. This time, please make a note.

    The error information is as follows:

    Collecting dlib
      Downloading https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz (3.4MB)
         |████████████████████████████████| 3.4MB 14kB/s
    Building wheels for collected packages: dlib
      Building wheel for dlib (setup.py) ... error
      ERROR: Complete output from command 'f:python36python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\fu\AppData\Local\Temp\pip-install-t50q34ym\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersfuAppDataLocalTemppip-wheel-g2i4oztb' --python-tag cp36:
      ERROR: running bdist_wheel
      running build
      running build_py
      package init file 'dlib__init__.py' not found (or not a regular file)
      running build_ext
      Traceback (most recent call last):
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 120, in get_cmake_version
          out = subprocess.check_output(['cmake', '--version'])
        File "f:python36libsubprocess.py", line 356, in check_output
          **kwargs).stdout
        File "f:python36libsubprocess.py", line 423, in run
          with Popen(*popenargs, **kwargs) as process:
        File "f:python36libsubprocess.py", line 729, in __init__
          restore_signals, start_new_session)
        File "f:python36libsubprocess.py", line 1017, in _execute_child
          startupinfo)
      FileNotFoundError: [WinError 2] The system cannot find the specified file.
    
      During handling of the above exception, another exception occurred:
    
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 261, in <module>
          'Topic :: Software Development',
        File "f:python36libsite-packagessetuptools__init__.py", line 143, in setup
          return distutils.core.setup(**attrs)
        File "f:python36libdistutilscore.py", line 148, in setup
          dist.run_commands()
        File "f:python36libdistutilsdist.py", line 955, in run_commands
          self.run_command(cmd)
        File "f:python36libdistutilsdist.py", line 974, in run_command
          cmd_obj.run()
        File "f:python36libsite-packageswheelbdist_wheel.py", line 192, in run
          self.run_command('build')
        File "f:python36libdistutilscmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "f:python36libdistutilsdist.py", line 974, in run_command
          cmd_obj.run()
        File "f:python36libdistutilscommandbuild.py", line 135, in run
          self.run_command(cmd_name)
        File "f:python36libdistutilscmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "f:python36libdistutilsdist.py", line 974, in run_command
          cmd_obj.run()
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 129, in run
          cmake_version = self.get_cmake_version()
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 125, in get_cmake_version
          "n*******************************************************************n")
      RuntimeError:
      *******************************************************************
       CMake must be installed to build the following extensions: dlib
      *******************************************************************
    
      ----------------------------------------
      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: Complete output from command 'f:python36python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\fu\AppData\Local\Temp\pip-install-t50q34ym\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersfuAppDataLocalTemppip-record-4kwg7hfvinstall-record.txt' --single-version-externally-managed --compile:
        ERROR: running install
        running build
        running build_py
        package init file 'dlib__init__.py' not found (or not a regular file)
        running build_ext
        Traceback (most recent call last):
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 120, in get_cmake_version
            out = subprocess.check_output(['cmake', '--version'])
          File "f:python36libsubprocess.py", line 356, in check_output
            **kwargs).stdout
          File "f:python36libsubprocess.py", line 423, in run
            with Popen(*popenargs, **kwargs) as process:
          File "f:python36libsubprocess.py", line 729, in __init__
            restore_signals, start_new_session)
          File "f:python36libsubprocess.py", line 1017, in _execute_child
            startupinfo)
        FileNotFoundError: [WinError 2] The system cannot find the specified file.
    
        During handling of the above exception, another exception occurred:
    
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 261, in <module>
            'Topic :: Software Development',
          File "f:python36libsite-packagessetuptools__init__.py", line 143, in setup
            return distutils.core.setup(**attrs)
          File "f:python36libdistutilscore.py", line 148, in setup
            dist.run_commands()
          File "f:python36libdistutilsdist.py", line 955, in run_commands
            self.run_command(cmd)
          File "f:python36libdistutilsdist.py", line 974, in run_command
            cmd_obj.run()
          File "f:python36libsite-packagessetuptoolscommandinstall.py", line 61, in run
            return orig.install.run(self)
          File "f:python36libdistutilscommandinstall.py", line 545, in run
            self.run_command('build')
          File "f:python36libdistutilscmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "f:python36libdistutilsdist.py", line 974, in run_command
            cmd_obj.run()
          File "f:python36libdistutilscommandbuild.py", line 135, in run
            self.run_command(cmd_name)
          File "f:python36libdistutilscmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "f:python36libdistutilsdist.py", line 974, in run_command
            cmd_obj.run()
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 129, in run
            cmake_version = self.get_cmake_version()
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 125, in get_cmake_version
            "n*******************************************************************n")
        RuntimeError:
        *******************************************************************
         CMake must be installed to build the following extensions: dlib
        *******************************************************************
    
        ----------------------------------------
    ERROR: Command "'f:python36python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\fu\AppData\Local\Temp\pip-install-t50q34ym\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersfuAppDataLocalTemppip-record-4kwg7hfvinstall-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:UsersfuAppDataLocalTemppip-install-t50q34ymdlib
    WARNING: You are using pip version 19.1, however version 19.1.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.
    

    Cmake and boost need to be installed before Dlib is installed. Then Dlib can be installed correctly

    pip install boost
    pip install cmake
    pip install dib
    

    Test installation results:

    C:Usersfu>python
    Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import dlib
    >>>
    

    I am trying to install dlib on Pycharm (which is similar to Anaconda) in order to use it for my Python and OpenCV face detection project.

    I have installed cMake and upgraded Python but there is still an error:

    Command

    pip install dlib
    

    Error

    FileNotFoundError: [WinError 2] The system cannot find the file specified
    

    Command output

    Collecting dlib
      Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
    Installing collected packages: dlib
    Running setup.py install for dlib: started
    Running setup.py install for dlib: finished with status 'error'
    Complete output from command C:UsersmehrsPycharmProjectsproject2venvScriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\mehrs\AppData\Local\Temp\pycharm-packaging\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersmehrsAppDataLocalTemppip-record-_nvwlk_iinstall-record.txt --single-version-externally-managed --compile --install-headers C:UsersmehrsPycharmProjectsproject2venvincludesitepython3.7dlib:
    running install
    running build
    running build_py
    package init file 'dlib__init__.py' not found (or not a regular file)
    warning: build_py: byte-compiling is disabled, skipping.
    
    running build_ext
    Traceback (most recent call last):
      File "C:UsersmehrsAppDataLocalTemppycharm-packagingdlibsetup.py", line 120, in get_cmake_version
        out = subprocess.check_output(['cmake', '--version'])
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libsubprocess.py", line 395, in check_output
        **kwargs).stdout
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libsubprocess.py", line 472, in run
        with Popen(*popenargs, **kwargs) as process:
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libsubprocess.py", line 775, in __init__
        restore_signals, start_new_session)
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libsubprocess.py", line 1178, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersmehrsAppDataLocalTemppycharm-packagingdlibsetup.py", line 261, in <module>
        'Topic :: Software Development',
      File "C:UsersmehrsPycharmProjectsproject2venvlibsite-packagessetuptools-39.1.0-py3.7.eggsetuptools__init__.py", line 129, in setup
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilsdist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UsersmehrsPycharmProjectsproject2venvlibsite-packagessetuptools-39.1.0-py3.7.eggsetuptoolscommandinstall.py", line 61, in run
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilscommandinstall.py", line 545, in run
        self.run_command('build')
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilscommandbuild.py", line 135, in run
        self.run_command(cmd_name)
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:UsersmehrsAppDataLocalProgramsPythonPython37-32libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UsersmehrsAppDataLocalTemppycharm-packagingdlibsetup.py", line 129, in run
        cmake_version = self.get_cmake_version()
      File "C:UsersmehrsAppDataLocalTemppycharm-packagingdlibsetup.py", line 125, in get_cmake_version
        "n*******************************************************************n")
    RuntimeError:
    *******************************************************************
     CMake must be installed to build the following extensions: dlib
    *******************************************************************
    
    
    ----------------------------------------
    
    Command "C:UsersmehrsPycharmProjectsproject2venvScriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\mehrs\AppData\Local\Temp\pycharm-packaging\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersmehrsAppDataLocalTemppip-record-_nvwlk_iinstall-record.txt --single-version-externally-managed --compile --install-headers C:UsersmehrsPycharmProjectsproject2venvincludesitepython3.7dlib" failed with error code 1 in C:UsersmehrsAppDataLocalTemppycharm-packagingdlib
    You are using pip version 10.0.1, however version 19.0.3 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.
    

    psychologist

    2 / 2 / 0

    Регистрация: 01.01.2010

    Сообщений: 189

    1

    27.03.2019, 22:46. Показов 9326. Ответов 6

    Метки нет (Все метки)


    я пытаюсь установить пакет face_recognition

    pip install face_recognition

    выходит ошибка

    Python
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    Command "c:usersСергейappdatalocalprogramspythonpython37python.exe -
    u -c "import setuptools, tokenize;__file__='C:\Users\D9F8~1\AppData\Local\T
    emp\pip-install-rhn9kcgv\dlib\setup.py';f=getattr(tokenize, 'open', open)(__f
    ile__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__
    , 'exec'))" install --record C:UsersD9F8~1AppDataLocalTemppip-record-lsr9_
    rnpinstall-record.txt --single-version-externally-managed --compile" failed wit
    h error code 1 in C:UsersD9F8~1AppDataLocalTemppip-install-rhn9kcgvdlib
    You are using pip version 18.1, however version 19.0.3 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' comm
    and.

    C:Windowssystem32>

    уже гуглил в инете
    cmake 100 раз уже установлен
    новый пип поставлен

    не помогло.

    __________________
    Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



    0



    114 / 22 / 3

    Регистрация: 11.09.2017

    Сообщений: 141

    Записей в блоге: 4

    28.03.2019, 08:51

    2

    psychologist, как вариант, причина может быть такая (Windows not officially supported, but might work), если конечно Вы читали документацию.



    0



    2 / 2 / 0

    Регистрация: 01.01.2010

    Сообщений: 189

    28.03.2019, 13:21

     [ТС]

    3

    tabbols95, да я читал на гитхабе, и что теперь, получается кому как повезет? у кого-то библиотека встанет ,а у кого-то нет? )
    А можно ли как поставить нужный мне package face_recognition без dlib.
    На Убунту кстати все встало. Но мне Убунту не всегда удобен))



    0



    1283 / 668 / 365

    Регистрация: 07.01.2019

    Сообщений: 2,176

    28.03.2019, 14:01

    4

    psychologist, попробуйте установить Visual Studio 2017Community Edition



    0



    0 / 0 / 3

    Регистрация: 23.06.2018

    Сообщений: 40

    02.08.2020, 10:01

    5

    pip install —no-dependencies face_recognition



    0



    1798 / 813 / 111

    Регистрация: 29.01.2013

    Сообщений: 4,862

    02.08.2020, 10:19

    6

    И очень сильно старайтесь, что бы в путях небыло кириллицы. Ну не любят её авторы большинства приложений, не любят!



    0



    Garry Galler

    Эксперт Python

    5403 / 3827 / 1214

    Регистрация: 28.10.2013

    Сообщений: 9,554

    Записей в блоге: 1

    02.08.2020, 16:55

    7

    Цитата
    Сообщение от psychologist
    Посмотреть сообщение

    получается кому как повезет? у кого-то библиотека встанет ,а у кого-то нет?

    Селяви :-)
    Вот мне повезло: на семерке x64 dlib скомпилировалась без всяких танцев с бубном и следования длинной инструкции по инсталляции. Я просто предварительно установил cmake для винды.

    Код

    C:UsersGarry>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 f:installpython38libsite-packages (from face_recognition) (0.3.0)
    Requirement already satisfied: Click>=6.0 in f:installpython38libsite-packages (from face_recognition) (7.1.2)
    Requirement already satisfied: numpy in f:installpython38libsite-packages (from face_recognition) (1.18.5+mkl)
    Requirement already satisfied: Pillow in f:installpython38libsite-packages (from face_recognition) (7.1.2)
    Collecting dlib>=19.7
      Using cached dlib-19.20.0.tar.gz (3.2 MB)
    Building wheels for collected packages: dlib
      Building wheel for dlib (setup.py) ... done
      Created wheel for dlib: filename=dlib-19.20.0-cp38-cp38-win_amd64.whl size=3640523 sha256=67c2842a6e52a45a077d0c6648ac8000fad07d1accb0
      Stored in directory: c:usersgarryappdatalocalpipcachewheelsa5822c2d2ccc604e2c2e35994b89a173d922331f1c6e1af9320a7602
    Successfully built dlib
    Installing collected packages: dlib, face-recognition
    Successfully installed dlib-19.20.0 face-recognition-1.3.0

    Python
    1
    2
    3
    4
    5
    6
    
    >>> import face_recognition
    >>> image = face_recognition.load_image_file("obama2.jpg")
    >>> face_locations = face_recognition.face_locations(image)
    >>> face_locations
    [(290, 438, 558, 171)]
    >>>

    Добавлено через 7 минут
    Ссылка на установочный Python 3.8 whl пакет со скомпилированной версией dlib для win7x64. Возможно, подойдет и для win810.



    0



    IT_Exp

    Эксперт

    87844 / 49110 / 22898

    Регистрация: 17.06.2006

    Сообщений: 92,604

    02.08.2020, 16:55

    7

    Python3 pip install dlib error:

    Before installing dlib, it took a long time. When reinstalling, some necessary conditions were forgotten. This time, I recorded it and memo.

    The error message is as follows:

    Collecting dlib
      Downloading https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz (3.4MB)
         |████████████████████████████████| 3.4MB 14kB/s
    Building wheels for collected packages: dlib
      Building wheel for dlib (setup.py) ... error
      ERROR: Complete output from command 'f:python36python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\fu\AppData\Local\Temp\pip-install-t50q34ym\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersfuAppDataLocalTemppip-wheel-g2i4oztb' --python-tag cp36:
      ERROR: running bdist_wheel
      running build
      running build_py
      package init file 'dlib__init__.py' not found (or not a regular file)
      running build_ext
      Traceback (most recent call last):
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 120, in get_cmake_version
          out = subprocess.check_output(['cmake', '--version'])
        File "f:python36libsubprocess.py", line 356, in check_output
          **kwargs).stdout
        File "f:python36libsubprocess.py", line 423, in run
          with Popen(*popenargs, **kwargs) as process:
        File "f:python36libsubprocess.py", line 729, in __init__
          restore_signals, start_new_session)
        File "f:python36libsubprocess.py", line 1017, in _execute_child
          startupinfo)
      FileNotFoundError: [WinError 2] The system cannot find the file specified.
    
      During handling of the above exception, another exception occurred:
    
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 261, in <module>
          'Topic :: Software Development',
        File "f:python36libsite-packagessetuptools__init__.py", line 143, in setup
          return distutils.core.setup(**attrs)
        File "f:python36libdistutilscore.py", line 148, in setup
          dist.run_commands()
        File "f:python36libdistutilsdist.py", line 955, in run_commands
          self.run_command(cmd)
        File "f:python36libdistutilsdist.py", line 974, in run_command
          cmd_obj.run()
        File "f:python36libsite-packageswheelbdist_wheel.py", line 192, in run
          self.run_command('build')
        File "f:python36libdistutilscmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "f:python36libdistutilsdist.py", line 974, in run_command
          cmd_obj.run()
        File "f:python36libdistutilscommandbuild.py", line 135, in run
          self.run_command(cmd_name)
        File "f:python36libdistutilscmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "f:python36libdistutilsdist.py", line 974, in run_command
          cmd_obj.run()
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 129, in run
          cmake_version = self.get_cmake_version()
        File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 125, in get_cmake_version
          "n*******************************************************************n")
      RuntimeError:
      *******************************************************************
       CMake must be installed to build the following extensions: dlib
      *******************************************************************
    
      ----------------------------------------
      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: Complete output from command 'f:python36python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\fu\AppData\Local\Temp\pip-install-t50q34ym\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersfuAppDataLocalTemppip-record-4kwg7hfvinstall-record.txt' --single-version-externally-managed --compile:
        ERROR: running install
        running build
        running build_py
        package init file 'dlib__init__.py' not found (or not a regular file)
        running build_ext
        Traceback (most recent call last):
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 120, in get_cmake_version
            out = subprocess.check_output(['cmake', '--version'])
          File "f:python36libsubprocess.py", line 356, in check_output
            **kwargs).stdout
          File "f:python36libsubprocess.py", line 423, in run
            with Popen(*popenargs, **kwargs) as process:
          File "f:python36libsubprocess.py", line 729, in __init__
            restore_signals, start_new_session)
          File "f:python36libsubprocess.py", line 1017, in _execute_child
            startupinfo)
             FileNotFoundError: [WinError 2] The system cannot find the file specified.
    
        During handling of the above exception, another exception occurred:
    
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 261, in <module>
            'Topic :: Software Development',
          File "f:python36libsite-packagessetuptools__init__.py", line 143, in setup
            return distutils.core.setup(**attrs)
          File "f:python36libdistutilscore.py", line 148, in setup
            dist.run_commands()
          File "f:python36libdistutilsdist.py", line 955, in run_commands
            self.run_command(cmd)
          File "f:python36libdistutilsdist.py", line 974, in run_command
            cmd_obj.run()
          File "f:python36libsite-packagessetuptoolscommandinstall.py", line 61, in run
            return orig.install.run(self)
          File "f:python36libdistutilscommandinstall.py", line 545, in run
            self.run_command('build')
          File "f:python36libdistutilscmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "f:python36libdistutilsdist.py", line 974, in run_command
            cmd_obj.run()
          File "f:python36libdistutilscommandbuild.py", line 135, in run
            self.run_command(cmd_name)
          File "f:python36libdistutilscmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "f:python36libdistutilsdist.py", line 974, in run_command
            cmd_obj.run()
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 129, in run
            cmake_version = self.get_cmake_version()
          File "C:UsersfuAppDataLocalTemppip-install-t50q34ymdlibsetup.py", line 125, in get_cmake_version
            "n*******************************************************************n")
        RuntimeError:
        *******************************************************************
         CMake must be installed to build the following extensions: dlib
        *******************************************************************
    
        ----------------------------------------
    ERROR: Command "'f:python36python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\fu\AppData\Local\Temp\pip-install-t50q34ym\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersfuAppDataLocalTemppip-record-4kwg7hfvinstall-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:UsersfuAppDataLocalTemppip-install-t50q34ymdlib
    WARNING: You are using pip version 19.1, however version 19.1.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.
    

    You need to install cmake and boost before installing dlib. Then you can install dlib correctly.

    pip install boost
    pip install cmake
    pip install dib
    

    Test the installation results:

    C:Usersfu>python
    Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import dlib
    >>>
    

    Понравилась статья? Поделить с друзьями:

    Читайте также:

  • Encountered error ora 12008
  • Encountered an error loading page
  • Em is an advanced debug mode как исправить
  • Dropbox как изменить место хранения
  • Dropbox error 404

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии