Error occurred when installing package dlib pycharm

0 votes and 4 comments so far on Reddit

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.

Как установить пакет dlib в PyCharm если pip не работает?

Collecting dlib
Using cached dlib-19.21.1.tar.gz (3.6 MB)
Using legacy ‘setup.py install’ for dlib, since package ‘wheel’ is not installed.
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status ‘error’

ERROR: Command errored out with exit status 1:
command: ‘C:Program FilesPython38python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\setup.py’»‘»‘; __file__=’»‘»‘C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\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:UsersVladimirAppDataLocalTemppip-record-pigi9lcbinstall-record.txt’ —single-version-externally-managed —user —prefix= —compile —install-headers ‘C:UsersVladimirAppDataRoamingPythonPython38Includedlib’
cwd: C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlib
Complete output (62 lines):
running install
running build
running build_py
package init file ‘toolspythondlib__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.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
Invoking CMake setup: ‘cmake C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlibtoolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlibbuildlib.win-amd64-3.8 -DPYTHON_EXECUTABLE=C:Program FilesPython38python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlibbuildlib.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 «», line 1, in
File «C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlibsetup.py», line 223, in
setup(
File «C:Program FilesPython38libsite-packagessetuptools__init__.py», line 165, in setup
return distutils.core.setup(**attrs)
File «C:Program FilesPython38libdistutilscore.py», line 148, in setup
dist.run_commands()
File «C:Program FilesPython38libdistutilsdist.py», line 966, in run_commands
self.run_command(cmd)
File «C:Program FilesPython38libdistutilsdist.py», line 985, in run_command
cmd_obj.run()
File «C:Program FilesPython38libsite-packagessetuptoolscommandinstall.py», line 61, in run
return orig.install.run(self)
File «C:Program FilesPython38libdistutilscommandinstall.py», line 545, in run
self.run_command(‘build’)
File «C:Program FilesPython38libdistutilscmd.py», line 313, in run_command
self.distribution.run_command(command)
File «C:Program FilesPython38libdistutilsdist.py», line 985, in run_command
cmd_obj.run()
File «C:Program FilesPython38libdistutilscommandbuild.py», line 135, in run
self.run_command(cmd_name)
File «C:Program FilesPython38libdistutilscmd.py», line 313, in run_command
self.distribution.run_command(command)
File «C:Program FilesPython38libdistutilsdist.py», line 985, in run_command
cmd_obj.run()
File «C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlibsetup.py», line 135, in run
self.build_extension(ext)
File «C:UsersVladimirAppDataLocalTemppip-install-wo1po3h2dlibsetup.py», line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File «C:Program FilesPython38libsubprocess.py», line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\tools\python’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\build\lib.win-amd64-3.8’, ‘-DPYTHON_EXECUTABLE=C:\Program Files\Python38\python.exe’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\build\lib.win-amd64-3.8’, ‘-A’, ‘x64′]’ returned non-zero exit status 1.
—————————————-
ERROR: Command errored out with exit status 1: ‘C:Program FilesPython38python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\setup.py’»‘»‘; __file__=’»‘»‘C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\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:UsersVladimirAppDataLocalTemppip-record-pigi9lcbinstall-record.txt’ —single-version-externally-managed —user —prefix= —compile —install-headers ‘C:UsersVladimirAppDataRoamingPythonPython38Includedlib’ Check the logs for full command output.
WARNING: You are using pip version 20.2.1; however, version 20.3.3 is available.
You should consider upgrading via the ‘C:Program FilesPython38python.exe -m pip install —upgrade pip’ command.

К слову, MS VC я поставил почти все версии, но ему просто плевать.
5fdb60a8949de623556718.png

Install Dlib on Windows

Install Dlib on Windows

In this post, we will provide step by step instructions on how to install Dlib on Windows.

Compiling Python modules such as NumPy, SciPy etc. is a tedious task. Anaconda is a great Python distribution which comes with a lot of pre-compiled Python packages. So we will use Anaconda as our Python distribution.

An alternative to Anaconda is that you install official Python library and use Christoph Gohlke’s awesome repository to install pre-compiled Python modules.

This tutorial is based on using Anaconda so we may not be able to help if you choose to use Gohlke’s precompiled binaries or if you compile Python libraries from source.

If you intend to use Dlib only in C++ projects, you can skip Python installation part.

Now let’s go through the steps to install Dlib. Follow our previous post Install OpenCV3 on Windows to complete Step 1, 2 and 3.

Step 1: Install Visual Studio 2015

Step 2: Install CMake v3.8.2

Step 3: Install Anaconda 3

Step 4: Download Dlib

Step 5: Build Dlib library

Extract this compressed file. Open Windows PowerShell or Command Prompt and move to the directory where you have extracted this file.

If you are running these commands on Command Prompt replace ` (backtick) with ^ (caret).

Dlib will be installed within dlib-19.6buildinstall directory. We will use CMake to build Dlib examples but you can use Visual Studio too. This directory (dlib-19.6buildinstall) contains include and library folders which you can specify in Visual Studio to build projects using Dlib.

Step 6: Update user environment variable – dlib_DIR

This environment variable is needed for CMake to find out where Dlib is installed. CMake looks for a file named dlibConfig.cmake within directory dlib_DIR to find Dlib’s include and library directories.

  1. Press Windows Super key, search for “environment variables”.
    Search System Environment Variables from Windows search menu
  2. Click Environment Variables in System Properties window.
    Edit Environment Variables
  3. Click New in “User Variables” (in upper half of window).
  4. Under variable name write dlib_DIR and under variable value write full path to directory dlib-19.6buildinstalllibcmakedlib
    On my machine path is: D:programmingdlib-19.6buildinstalllibcmakedlib
    This directory contains file “dlibConfig.cmake”. This is used by CMake to configure dlib_LIBS and dlib_INCLUDE_DIRS variables to generate project files. Before assigning the value to variable dlib_DIR make sure that this path has file dlibConfig.cmake.
  5. Now click ok to save and close environment variables window.

Note: If you have an open Command Prompt/Power Shell window before these values were updated, you have to close and open a new Command Prompt/Power Shell window again.

Step 7: Build Dlib examples

We will use our CMakeLists.txt file instead of one which is shipped with Dlib.
Download modified CMakeLists.txt file and put it in dlib-19.6examples directory and replace the default one with this one. Then follow the steps given below:

Once build is complete, it will generate executables for all examples in examplesbuildRelease folder.

Step 8: Test Dlib’s C++ example

We will test Face Landmark Detection demo to check whether we have installed Dlib correctly.
Download trained model of facial landmarks from Dlib’s website. Extract this file (shape_predictor_68_face_landmarks.dat.bz2) to Dlib’s root directory (dlib-19.6).

Step 9: Install Dlib’s Python module (Only Anaconda 3)

Compiling Python bindings for Dlib from source is non-trivial. You have to compile Boost.Python from scratch and configure some environment variables (such as BOOST_ROOT and BOOST_LIBRARYDIR) before you can compile Python module of Dlib. We are skipping that part for now. A complete tutorial on how to build Dlib Python bindings from source will be released in future.

To save time and efforts it is suggested to use Anaconda 3. You can install a compiled binary of dlib v19.4 from Anaconda. At the time this article was updated Dlib’s latest available version on Anaconda’s conda-forge repository is 19.4. So we will install v19.4 instead of 19.6

Step 10: Test Dlib’s Python example

Subscribe & Download Code

If you liked this article and would like to download code (C++ and Python) and example images used in this post, please click here. Alternately, sign up to receive a free Computer Vision Resource Guide. In our newsletter, we share OpenCV tutorials and examples written in C++/Python, and Computer Vision and Machine Learning algorithms and news.

Русские Блоги

Введение в библиотеку dlib под windows, решение проблем с установкой и простые примеры (python)

1. Введение в dlib
Dlib — это современный фреймворк C ++, который решает проблемы реализации алгоритмов машинного обучения и разработки сложного программного обеспечения. Он широко используется в промышленных и академических областях исследований, включая роботов, встраиваемые устройства и мобильные телефоны. А в крупномасштабной высокопроизводительной вычислительной среде открытый исходный код DLib делает его удобным и бесплатным.
Основные возможности Dlib: полная документация, высококачественный код, алгоритмы машинного обучения, алгоритмы научных вычислений, алгоритмы вывода модели графа, обработка изображений, многопоточность, сетевое программирование, графический пользовательский интерфейс, сжатие данных А алгоритм интеграции можно посмотреть в описании официального сайта:http://dlib.net

Два, установка dlib
Установка библиотеки dlib все еще обычно сталкивается с небольшими проблемами, и мне потребовалось много времени, чтобы использовать ее в первый раз. Позвольте мне объяснить здесь, что моя среда — 64-битная win7 + Python3.6.6 + opencv-python 4.0.0.21.

1. Сначала установите модуль opencv
напрямую введите pip install opencv-python в режиме cmd

2. Установите библиотеку dlib.
В Интернете есть много мнений. Большинство из них говорят, что сначала нужно установить cmake и boost, но это не обязательно. Вот два простых метода:
Метод 1. Введите pip install dlib == 19.6.1 непосредственно в режиме cmd, как показано на рисунке ниже (конечно, вы также можете установить другие версии, метод аналогичен, я установил его позже 19.7.0 версия)

Метод 2. Установка непосредственно в pycharm (но обратите внимание на соответствующий номер версии, потому что pycharm по умолчанию является последней версией)
File-settings-Project Interpreter-…

Дополнение: установка прошла успешно, когда я пришел сюда, но некоторые друзья, должно быть, обнаружили, что, хотя проблем с import dlib нет, при запуске кода сообщалось об ошибке: Detector = dlib.get_frontal_face_detector () AttributeError: module ‘ dlib ‘не имеет атрибута’get_frontal_face_detector’ или не может открыть’get_frontal_face_detector ‘и другие проблемы, поскольку вы не загрузили библиотеку лиц shape_predictor_68_face_landmarks, вам необходимо загрузить ее, разархивировать и поместить в папку, где находится ваш код.
Ссылка для загрузки библиотеки Face:http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2

3. Простой небольшой пример: обнаружение лиц и выделение ключевых точек на любом изображении.
(1) Принцип и шаги:
а) Сначала прочтите изображение с помощью opencv (img = cv2.imread («duoren.jpg»)
б) Вызовите средство извлечения лиц, предоставленное библиотекой dlib, и обнаружите, что на изображении нет лиц. Если лиц нет, выведите количество обнаруженных лиц и выполните выделение ориентиров. Вывод: лицо не обнаружено
Detector = dlib.get_frontal_face_detector () # Используйте средство извлечения лиц, предоставленное библиотекой dlib
predictor = dlib.shape_predictor (‘shape_predictor_68_face_landmarks.dat’) # Создайте средство извлечения функций
c) Используйте cv2.circle, чтобы нарисовать круг для каждой характерной точки, всего 68
cv2.circle(img, pos, 5, color=(0, 255, 0))

(2) Отображение эффекта:

Рис. 1. Режим одиночной игры.

Рис. 2. Многопользовательский режим.

4. Получение кода:
Отсканируйте код и следуйте за общедоступной учетной записью WeChat «StrongerTang», введите ключевое слово «dlib small example», чтобы получить его.
Другие материалы доступны бесплатно.

I am a beginner in the Python programming language. I am Working on a project for facial landmark detection in Python. For this I am trying to use dlib.

I am using PyCharm IDE for Python programming language, but when I am trying to install dlib library on my PyCharm package then I am getting the following error.

error

Can anyone please help me solving this.

Edit:
Here is the complete error that I am getting.

**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 /Users/mayanktiwari/human_detect/untitled/bin/python -u -c «import setuptools, tokenize;file=’/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/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 /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pip-record-hq673j64/install-record.txt —single-version-externally-managed —compile —install-headers /Users/mayanktiwari/human_detect/untitled/include/site/python3.7/dlib:
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.7.2 (default, Dec 27 2018, 07:35:52)
Invoking CMake setup: 'cmake /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.13-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/mayanktiwari/human_detect/untitled/bin/python -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_dc7d9/fast"
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun




  CMake will not be able to correctly generate this project.


-- Configuring incomplete, errors occurred!
See also "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "/Users/mayanktiwari/human_detect/untitled/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/setuptools/__init__.py", line 145, in setup
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/mayanktiwari/human_detect/untitled/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/setuptools/command/install.py", line 61, in run
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
    self.run_command('build')
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 135, in run
    self.build_extension(ext)
  File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.13-x86_64-3.7', '-DPYTHON_EXECUTABLE=/Users/mayanktiwari/human_detect/untitled/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

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

Command «/Users/mayanktiwari/human_detect/untitled/bin/python -u -c «import setuptools, tokenize;file=’/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/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 /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pip-record-hq673j64/install-record.txt —single-version-externally-managed —compile —install-headers /Users/mayanktiwari/human_detect/untitled/include/site/python3.7/dlib» failed with error code 1 in /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/**

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

I just wanted to install dlib on my Windows 10. I installed cmake and MS Visual 14 2015, which is needed to compile it.
So i opened my Anaconda Enviroment and typed pip install dlib it took a while but installed 19.13.1 successfully. I can run
python and then import dlib dlib.__version__ without any problem. It tells me 19.13.1. I can also run dlib.__file__ and it tells me: D:\Programme\Anaconda3\envs\Pytorch\lib\site-packages\dlib.cp36-win_amd64.pyd

But when i use this enviroment, where dlib seems to work, in Pycharm, i cannot Import it. It just tells me

ImportError: DLL load failed:….

Anyone a idea why I can’t use Pycharm with dlib? Or is there a way to get it to work?

Thanks

Edit:
It is also shown here:
Project Interpreter Settings

asked Jun 11, 2018 at 20:05

Dezarius's user avatar

DezariusDezarius

231 gold badge1 silver badge6 bronze badges

One way to do it :

In PyCharm, Files > Settings > "Project:<nameofyourproject> > Project Interpreter,
you can see the current Python interpreter used by PyCharm for your project on the top of the window.

If it is not the right one, click on the wheel and Add... > Conda Interpreter > click on the box Existing environment and choose it from the list below. If Anaconda is not installed in the default path, your environment will not show up there. So, click on the ... button to find the path of the python executable of your anaconda environment.
Path/to/your/anaconda3/env/bin/python

Once your environment is properly set, you can install dlib directly from PyCharm.
Again, go to Files > Settings > "Project:<nameofyourproject> > Project Interpreter. Here, under the path to the interpreter, you can see the list of the installed CONDA packages. On the right of the list there is a button representing a green circle. Deactivate it (click on it) to see all NON-CONDA installed packages. Then, click on the green cross button to add a package. From the new window, type dlib and install it by clicking Install Package.

Wait for the installation. Now importing dlib should work.

answered Aug 1, 2018 at 8:30

Jérôme Bruzaud's user avatar

You have to pick correct interpreter.
Click Ctrl+Shift+A, type «Project interpreter», and choose «Anaconda3» in the drop-down menu.

answered Jun 11, 2018 at 20:11

Jan Jurec's user avatar

Jan JurecJan Jurec

491 silver badge13 bronze badges

1

Before installing the dlib package in pycharm, first you need to download the visual studio community then you get page with some installers there you need to select Desktop development with C++ and install. It will take some time.

Then go to the Pycharm<settings<Python interpreter add the dlib package and install, better to install some old version 19.10.1. We are having issues with some old versions.

It will take some time, but will be installed.

answered Nov 20, 2020 at 6:25

Srinu's user avatar

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++.

answered Jun 15, 2021 at 15:44

Salio's user avatar

SalioSalio

9359 silver badges19 bronze badges

Понравилась статья? Поделить с друзьями:
  • Error occurred turn the main power switch off and on f000 kyocera
  • Error occurred see the logfile
  • Error opening file logo soft comfort
  • Error occurred raid 0 как исправить
  • Error opening file for writing samp d3dx9 25