0

I receive the below error while installing dlib, Kindly help me to install dlib==19.16.0 on ubuntu 24.04 for the python version 2.7.18.

pip install dlib
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting dlib
  Using cached dlib-19.24.4.tar.gz (3.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: dlib
  Building wheel for dlib (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python2.7 /usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpGKSFp7
       cwd: /tmp/pip-install-maOjcc/dlib
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_ext
  Traceback (most recent call last):
    File "/usr/local/bin/cmake", line 5, in <module>
      from cmake import cmake
  ImportError: No module named cmake
  
  ERROR: CMake must be installed to build dlib
  
  ----------------------------------------
  ERROR: Failed building wheel for dlib
Failed to build dlib
ERROR: Could not build wheels for dlib which use PEP 517 and cannot be installed directly
2
  • 2
    As clearly written in the error message, support in python2 and pip2 were dropped in 2020 and 2021. Use Python 3. Commented Jun 20 at 13:56
  • This is an XY Problem. Why are you not using python3? Commented Jun 20 at 13:57

0

You must log in to answer this question.