之前提示
```
You must use Visual Studio to build a python extension on windows. If you are getting this error it means you have not installed Visual C++. Note that there are many flavors of Visual Studio, like Visual Studio for C# development. You need to install Visual Studio for C++.
```
于是就去官网装了VS2019。接着装cmake和boost
```
pip install cmake boost
```
装dlib的时候倒是成功了
```
Successfully built dlib
Installing collected packages: dlib
Successfully installed dlib-19.22.1
```
然而我在pycharm里面import dlib的时候却提示
```
import dlib
File "D:\Anaconda3\envs\tf\lib\site-packages\dlib\__init__.py", line 19, in <module>
from _dlib_pybind11 import *
ImportError: DLL load failed: 找不到指定的程序。
```
搜了一下别人的博客[ImportError: DLL load failed: 找不到指定的模块_. 水怪的博客-CSDN博客],里面提到可能是.whl的文件有残缺或者dlib的版本过旧导致的。但重装后还是不行。在知乎上搜到了这个问题dlib人脸识别 模块 如何 在Python 中安装? - 知乎。其中马蹄急提到用19.6.0安装成功但导入失败,换成19.6.1就可以了。于是重装
```
pip install dlib==19.6.1
```
可以了,好烦。一早上又浪费了。