更新时间:2022-06-21 01:33:53
我认为错误消息还有很多,可能与CMake有关,要么安装不正确,要么与 pip3 install dlib不兼容
.
I think there's more to the error message and it's probably related to CMake, either it's not installed properly or it's not compatible with the pip3 install dlib
.
我建议使用 Homebrew 来安装Python3(包括pip3)和CMake.Homebrew管理可能依赖于系统相关工具,路径等的程序包,工具,库的安装.它还使您不必使用 sudo
在系统上安装程序.
I suggest using Homebrew to install Python3 (which includes pip3) and CMake. Homebrew manages the installation of packages, tools, libraries that might depend on system-related tools, paths, etc. It also prevents you from having to use sudo
to install stuff on your system.
安装自制软件
Install Homebrew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
使用Homebrew安装Python3(和pip3)
Install Python3 (and pip3) using Homebrew
$ brew install python@3.7 # or python@3.8 or python@3.9
$ brew install python@3 # get whichever is the latest version
检查Python安装
$ python3 -V
$ python3 -m pip -V
使用Homebrew安装CMake
Install CMake using Homebrew
$ brew install cmake
检查CMake安装
$ brew info cmake
$ cmake --version
最后,使用 pip
$ python3 -m pip install dlib
如果您不想使用Homebrew(由于某种原因),可以尝试从以下位置使用安装程序(dmg或tar.gz)直接安装Mac版CMake: 查看全文