当前文章: 首页 >> 编程开发 >> CMake must be installed to build the following extensions: dlib
«    2021年7月    »
1234
567891011
12131415161718
19202122232425
262728293031
网站分类
访客信息
    标签列表
    最近发表
    友站访问排行

      CMake must be installed to build the following extensions: dlib

      执行以下命令安装face_recognition:

      pip3 install face_recognition


      出现错误:

      Collecting face_recognition
        Using cached https://files.pythonhosted.org/packages/1e/95/f6c9330f54ab07bfa032bf3715c12455a381083125d8880c43cbe76bb3d0/face_recognition-1.3.0-py2.py3-none-any.whl
      Collecting face-recognition-models>=0.3.0 (from face_recognition)
      Collecting Pillow (from face_recognition)
        Using cached https://files.pythonhosted.org/packages/19/5e/23dcc0ce3cc2abe92efd3cd61d764bee6ccdf1b667a1fb566f45dc249953/Pillow-7.0.0-cp36-cp36m-manylinux1_x86_64.whl
      Collecting numpy (from face_recognition)
        Using cached https://files.pythonhosted.org/packages/07/08/a549ba8b061005bb629b76adc000f3caaaf881028b963c2e18f811c6edc1/numpy-1.18.2-cp36-cp36m-manylinux1_x86_64.whl
      Collecting dlib>=19.7 (from face_recognition)
        Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
      Collecting Click>=6.0 (from face_recognition)
        Using cached https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl
      Building wheels for collected packages: dlib
        Running setup.py bdist_wheel for dlib ... error
        Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nx4j043q/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmplur46jlepip-wheel- --python-tag cp36:
        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 "/tmp/pip-build-nx4j043q/dlib/setup.py", line 120, in get_cmake_version
            out = subprocess.check_output(['cmake', '--version'])
          File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
            **kwargs).stdout
          File "/usr/lib/python3.6/subprocess.py", line 423, in run
            with Popen(*popenargs, **kwargs) as process:
          File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
            restore_signals, start_new_session)
          File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
            raise child_exception_type(errno_num, err_msg, err_filename)
        FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'
        During handling of the above exception, another exception occurred:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-build-nx4j043q/dlib/setup.py", line 261, in <module>
            'Topic :: Software Development',
          File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
            return distutils.core.setup(**attrs)
          File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
            dist.run_commands()
          File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
            self.run_command(cmd)
          File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
            cmd_obj.run()
          File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204, in run
            self.run_command('build')
          File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
            cmd_obj.run()
          File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
            self.run_command(cmd_name)
          File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
            cmd_obj.run()
          File "/tmp/pip-build-nx4j043q/dlib/setup.py", line 129, in run
            cmake_version = self.get_cmake_version()
          File "/tmp/pip-build-nx4j043q/dlib/setup.py", line 125, in get_cmake_version
            "\n*******************************************************************\n")
        RuntimeError:
        *******************************************************************
         CMake must be installed to build the following extensions: dlib
        *******************************************************************
      
        ----------------------------------------
        Failed building wheel for dlib
        Running setup.py clean for dlib
      Failed to build dlib
      Installing collected packages: face-recognition-models, Pillow, numpy, dlib, Click, face-recognition
      
        Running setup.py install for dlib ... error
          Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nx4j043q/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xzvlsm30-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
          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 "/tmp/pip-build-nx4j043q/dlib/setup.py", line 120, in get_cmake_version
              out = subprocess.check_output(['cmake', '--version'])
            File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
              **kwargs).stdout
            File "/usr/lib/python3.6/subprocess.py", line 423, in run
              with Popen(*popenargs, **kwargs) as process:
            File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
              restore_signals, start_new_session)
            File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
              raise child_exception_type(errno_num, err_msg, err_filename)
          FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'
          During handling of the above exception, another exception occurred:
          Traceback (most recent call last):
            File "<string>", line 1, in <module>
            File "/tmp/pip-build-nx4j043q/dlib/setup.py", line 261, in <module>
              'Topic :: Software Development',
            File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
              return distutils.core.setup(**attrs)
            File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
              dist.run_commands()
            File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
              self.run_command(cmd)
            File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
              cmd_obj.run()
            File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
              return orig.install.run(self)
            File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
              self.run_command('build')
            File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
              self.distribution.run_command(command)
            File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
              cmd_obj.run()
            File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
              self.run_command(cmd_name)
            File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
              self.distribution.run_command(command)
            File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-nx4j043q/dlib/setup.py", line 129, in run
              cmake_version = self.get_cmake_version()
            File "/tmp/pip-build-nx4j043q/dlib/setup.py", line 125, in get_cmake_version
              "\n*******************************************************************\n")
          RuntimeError:
          *******************************************************************
           CMake must be installed to build the following extensions: dlib
          *******************************************************************
      
          ----------------------------------------
      Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nx4j043q/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xzvlsm30-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-nx4j043q/dlib/



      解决:

      pip3 install cmake


      如果安装cmake也出现错误,请参考:http://blog.jues.org.cn/post/Command-python-setup-py-egg_info-failed-with-error-code-1-in-tmp-pip-build-2a__raai-cmake.html

      声明:本站原创文章,转载、复制、使用等请注明出处。
      标题CMake must be installed to build the following extensions: dlib
      作者jues
      地址: http://blog.jues.org.cn/post/CMake%20must%20be%20installed%20to%20build%20the%20following%20extensions%3A%20dlib.html

      发表评论:

      Powered By Z-BlogPHP 1.7.0 Powered By Z-BlogPHP © 2018 jues博客 Copyright Your WebSite.Some Rights Reserved.联系站长 Themes by jues