英文:
error while install dlib on cmd, could not build wheels for dlib
问题
我在尝试在命令行上安装dlib时遇到了这个错误
我已经安装了CMake版本3.26.1
Visual Studio
Python版本是3.10
pip安装dlib
和结果
收集dlib
使用缓存的dlib-19.24.1.tar.gz(3.2 MB)
安装构建依赖项...完成
获取构建轮子的要求...完成
准备元数据(pyproject.toml)...完成
为已收集的软件包构建轮子:dlib
构建dlib轮子(pyproject.toml)...错误
错误:子进程以错误退出
× 构建dlib轮子(pyproject.toml)未成功运行。
│ 退出代码:1
╰─> [14行输出]
运行bdist_wheel
运行构建
运行构建_py
运行构建_ext
回溯(最近的调用最后):
文件“C:\Users\shiri\AppData\Local\Programs\Python\Python310\lib\runpy.py”,第196行,在_run_module_as_main内
返回_run_code(code,main_globals,无)
文件“C:\Users\shiri\AppData\Local\Programs\Python\Python310\lib\runpy.py”,第86行,在_run_code内
执行(代码,run_globals)
文件“C:\Users\shiri\AppData\Local\Programs\Python\Python310\Scripts\cmake.exe_main_.py”,第4行,在
ModuleNotFoundError:找不到名为'cmake'的模块
错误:必须安装CMake才能构建dlib
[输出结束]
注意:此错误源自子进程,可能不是pip的问题。
错误:构建dlib轮子失败
无法构建dlib的轮子
错误:无法构建dlib的轮子,这是安装基于pyproject.toml的项目所必需的
英文:
im getting this error while trying o install dlib on cmd
i already install cmake version 3.26.1
visual studio
n python version is 3.10
pip install dlib
and the results
Collecting dlib
Using cached dlib-19.24.1.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for dlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
Traceback (most recent call last):
File "C:\Users\shiri\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\shiri\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\shiri\AppData\Local\Programs\Python\Python310\Scripts\cmake.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'cmake'
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
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
i dont know what to do, please help:"
答案1
得分: 1
> 错误: 需要安装 CMake 才能构建 dlib
您可以在终端中执行以下命令:
pip install cmake
然后重新安装 dlib
。
您说您已安装 cmake 包,您也可以检查是否选择了正确的 Python 解释器。
英文:
> ERROR: CMake must be installed to build dlib
You can do these commands in terminal:
pip install cmake
Then reinstall dlib
.
You said you have installed the cmake package, you can also check whether you have chosen the correct Python interpreter.
答案2
得分: 0
升级 pip 和 setuptools: 在尝试重新安装 dlib 之前,您可以使用以下命令升级 pip 和 setuptools 的最新版本:
pip install --upgrade pip setuptools
重试安装 dlib: 现在,您可以尝试使用 pip 重新安装 dlib:
pip install dlib
英文:
Upgrade pip and setuptools: Before attempting to install dlib again, you can upgrade pip and setuptools to their latest versions using the following command:
pip install --upgrade pip setuptools
Retry installing dlib: Now, you can try installing dlib again using pip:
pip install dlib
答案3
得分: 0
对于在 Linux 上运行的人,这对我有帮助。
安装 build-essential 软件包,其中包括 gcc 和 g++ 编译器以及 make,还有 cmake。
yum install -y gcc-c++ make cmake
英文:
For those running on a linux this helped me.
Install the build-essential package, which includes the gcc and g++ compilers and make, along with cmake.
yum install -y gcc-c++ make cmake
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论