Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
970 views
in Technique[技术] by (71.8m points)

python - failing to install dlib on windows 10

Trying to install dlib on Windows 10 using pycharm package manager. I have Numpy, opencv-python, setuptools and wheel installed. tried installing dlib then got the first error asking me to install CMake.

Now I'm getting this: (tried installing visual studio but it had no effect).

    Collecting dlib   Using cached https://files.pythonhosted.org/packages/d5/5c/aa64510aa354d562ecba7edecd500b020280741140e5d91ff5ec1c6f8289/dlib-19.13.1.tar.gz Building wheels for collected packages: dlib   Running setup.py bdist_wheel for dlib: started   Running setup.py bdist_wheel for dlib: finished with status 'error'   Complete output from command C:UsersTomvenvScriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:UsersTomAppDataLocalTemppip-wheel-f_njkl2_ --python-tag cp36:  running bdist_wheel   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   Building extension for Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] Invoking CMake setup: 'cmake C:UsersTomAppDataLocalTemppycharm-packagingdliboolspython
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsersTomAppDataLocalTemppycharm-packagingdlibuildlib.win32-3.6
-DPYTHON_EXECUTABLE=C:UsersTomvenvScriptspython.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsersTomAppDataLocalTemppycharm-packagingdlibuildlib.win32-3.6'
-- Building for: NMake Makefiles   -- The C compiler identification is unknown   -- The CXX compiler identification is unknown   CMake Error in CMakeLists.txt:
    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 in CMakeLists.txt:
    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/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log". See also "C:/Users/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log". Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:UsersTomAppDataLocalTemppycharm-packagingdlibsetup.py", line 256, in <module>
      'Topic :: Software Development',
    File "C:UsersTomvenvlibsite-packagessetuptools-39.1.0-py3.6.eggsetuptools\__init__.py", line 129, in setup
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscore.py", line 148, in setup
      dist.run_commands()
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 955, in run_commands
      self.run_command(cmd)
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 974, in run_command
      cmd_obj.run()
    File "C:UsersTomvenvlibsite-packageswheeldist_wheel.py", line 202, in run
      self.run_command('build')
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 974, in run_command
      cmd_obj.run()
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscommanduild.py", line 135, in run
      self.run_command(cmd_name)
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 974, in run_command
      cmd_obj.run()
    File "C:UsersTomAppDataLocalTemppycharm-packagingdlibsetup.py", line 133, in run
      self.build_extension(ext)
    File "C:UsersTomAppDataLocalTemppycharm-packagingdlibsetup.py", line 169, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "C:UsersTomAppDataLocalProgramsPythonPython36-32libsubprocess.py", line 291, in check_call
      raise CalledProcessError(retcode, cmd)   subprocess.CalledProcessError: Command '['cmake', 'C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6', '-DPYTHON_EXECUTABLE=C:\Users\Tom\venv\Scripts\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6']' returned non-zero exit status 1.
     ----------------------------------------   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'
    Complete output from command C:UsersTomvenvScriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install
--record C:UsersTomAppDataLocalTemppip-record-1kold5c8install-record.txt
--single-version-externally-managed --compile --install-headers C:UsersTomvenvincludesitepython3.6dlib:
    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
    Building extension for Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)]
    Invoking CMake setup: 'cmake C:UsersTomAppDataLocalTemppycharm-packagingdliboolspython
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsersTomAppDataLocalTemppycharm-packagingdlibuildlib.win32-3.6
-DPYTHON_EXECUTABLE=C:UsersTomvenvScriptspython.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsersTomAppDataLocalTemppycharm-packagingdlibuildlib.win32-3.6'
    -- Building for: NMake Makefiles
    -- The C compiler identification is unknown
    -- The CXX compiler identification is unknown
    CMake Error in CMakeLists.txt:
      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 in CMakeLists.txt:
      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/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersTomAppDataLocalTemppycharm-packagingdlibsetup.py", line 256, in <module>
        'Topic :: Software Development',
      File "C:UsersTomvenvlibsite-packagessetuptools-39.1.0-py3.6.eggsetuptools\__init__.py", line 129, in setup
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersTomvenvlibsite-packagessetuptools-39.1.0-py3.6.eggsetuptoolscommandinstall.py", line 61, in run
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscommandinstall.py", line 545, in run
        self.run_command('build')
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscommanduild.py", line 135, in run
        self.run_command(cmd_name)
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersTomAppDataLocalTemppycharm-packagingdlibsetup.py", line 133, in run
        self.build_extension(ext)
      File "C:UsersTomAppDataLocalTemppycharm-packagingdlibsetup.py", line 169, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "C:UsersTomAppDataLocalProgramsPythonPython36-32libsubprocess.py", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6', '-DPYTHON_EXECUTABLE=C:\Users\Tom\venv\Scripts\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6']' returned non-zero exit status 1.

    ----------------------------------------

  Failed building wheel for dlib Command "C:UsersTomvenvScriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compil

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...