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 ╰─> [7 lines of output] running bdist_wheel running build running build_py 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 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 ╰─> [9 lines of output] running install D:\Anaconda3\Anaconda\lib\site-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 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.
时间: 2024-02-15 10:28:22 浏览: 748
这个错误是因为缺少CMake,dlib需要使用CMake进行编译。您需要先安装CMake,然后再重新安装dlib库。以下是在Windows上安装CMake和dlib的步骤:
1. 下载CMake安装程序:您可以从CMake的官方网站 https://cmake.org/download/ 下载适合您的操作系统的CMake安装程序。
2. 安装CMake:运行下载的CMake安装程序,按照提示进行安装。
3. 安装dlib库:在命令行中输入以下命令来安装dlib库:
```
pip install dlib
```
如果您已经安装了dlib库,可以使用以下命令卸载它:
```
pip uninstall dlib
```
然后再重新安装dlib库:
```
pip install dlib
```
如果您还遇到了其他问题,请参考dlib的文档或在dlib的GitHub页面上查找更多信息。
相关问题
卡在最后没有进展Collecting dlib Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ec/e3/4fed0fb511a88a46365c2da493b73081a5e1a21960bdb18089b27cbc768b/dlib-19.24.1.tar.gz (3.2 MB) Preparing metadata (setup.py) ... done Building wheels for collected packages: dlib Building wheel for dlib (setup.py) ... \
这可能是由于您的系统资源不足或网络连接不稳定导致的。您可以尝试以下几个步骤:
1. 检查您的网络连接是否正常,可以尝试使用其他网络连接方式或者等待一段时间后再次尝试安装。
2. 检查您的系统资源使用情况,确保您的系统有足够的空闲内存和硬盘空间。
3. 您可以尝试使用其他源来安装 dlib,例如使用清华大学的 PyPI 镜像,命令如下:
```pip install dlib -i https://pypi.tuna.tsinghua.edu.cn/simple```
或者使用 conda 安装,命令如下:
```conda install -c conda-forge dlib```
如果以上方法都无法解决问题,请提供更多的错误信息或者日志,以便我能够更好地帮助您解决问题。
WARNING: Ignoring invalid distribution -yasn1 (/usr/local/lib/python3.7/dist-packages) Collecting dlib Downloading dlib-19.24.1.tar.gz (3.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 16.3 kB/s eta 0:00:00 Preparing metadata (setup.py) ... done Building wheels for collected packages: dlib Building wheel for dlib (setup.py) ... |
It seems like there was an error during the installation of the dlib package. The warning message indicates that an invalid distribution was ignored.
To troubleshoot this issue, you can try uninstalling and reinstalling the dlib package using pip. Here are the steps:
1. Uninstall the current installation of the dlib package using pip:
```
pip uninstall dlib
```
2. Reinstall the dlib package:
```
pip install dlib
```
If the error persists, you can try updating pip and setuptools by running:
```
pip install --upgrade pip setuptools
```
This should ensure that you have the latest versions of these packages, which may help resolve any compatibility issues.
阅读全文