pip install dlib -i https://pypi.tuna.tsinghua.edu.cn/simple WARNING: Ignoring invalid distribution -yasn1 (/usr/local/lib/python3.7/dist-packages) Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting dlib Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ec/e3/4fed0fb511a88a46365c2da493b73081a5e1a21960bdb18089b27cbc768b/dlib-19.24.1.tar.gz (3.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 3.0 MB/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 ╰─> [10 lines of output] running bdist_wheel running build running build_py Generating grammar tables from /usr/lib/python3.7/lib2to3/Grammar.txt Generating grammar tables from /usr/lib/python3.7/lib2to3/PatternGrammar.txt package init file 'tools/python/dlib/__init__.py' not found (or not a regular file) 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 Running setup.py clean for dlib Failed to build dlib ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
时间: 2023-12-06 12:43:17 浏览: 422
这个错误提示是因为你需要先安装CMake来构建dlib。你可以使用以下命令来安装CMake:
```bash
sudo apt-get install cmake
```
或者使用以下命令安装dlib:
```bash
pip install dlib --install-option="--no DLIB_USE_CUDA"
```
这个命令会安装dlib但不包括CUDA支持。
相关问题
3. 为 python 安装 pandas 库,且采用镜像网站:https://pypi.tuna.tsinghua.edu.cn/simple,则在 cmd 窗口输入( )。 (A)pip install pandas https://pypi.tuna.tsinghua.edu.cn/simple (B)pip install pandas -h https://pypi.tuna.tsinghua.edu.cn/simple (C)pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple (D)pip install pandas -k https://pypi.tuna.tsinghua.edu.cn/simple答案是什么为什么
答案是:(C)pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple。
这是因为选项(C)中的 `-i` 参数可以指定库的安装源为指定的镜像网站。在这个情况下,`https://pypi.tuna.tsinghua.edu.cn/simple` 是指定的镜像网站,通过使用 `-i` 参数,可以将安装源设置为该镜像网站。
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn numpy
As an AI language model, I do not have the capability to install packages or execute commands on a local machine. However, the following command will install numpy using pip with Tsinghua University mirror:
```
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn numpy
```
This command will use the Tsinghua University mirror as the source for the package and the `--trusted-host` option is used to avoid SSL warnings.
阅读全文