python3.7 install Dlib library

write in front

This article will record several different installation experiences. Not every method is successful, so it is best to browse the full text first and then choose a method to try.
https://pypi.org/simple/dlib/

The first one (the only one I succeeded with)

Download the whl file offline and install it using pip.

Several URLs are provided for downloading: URL 1 (as shown below, the version is only up to 3.6), URL 2 (Dlib’s official website)
I downloaded version 3.7 from elsewhere: dlib-19.19.0-cp37-cp37m-win_amd64.whl

The interface opened by URL 1
Specific steps:
You can refer to this article
1. Go to the above website to download the required whl file (note that the version and python must correspond). I use dlib-19.19.0-cp37-cp37m-win_amd64.whl.

2. Copy and paste the whl file downloaded in the previous step into the Scripts directory of the file where python is located (view the Scripts directory: take pycharm as an example, File-Settings-Project-Python interpreter, you can see the directory at the top right).

3. Jump to the directory mentioned in step 2 in the terminal (for example: cd D:\python\project1\venv\Scripts), and then enter: pip install complete file name.whl (for example: pip install dlib-19.19 .0-cp37-cp37m-win_amd64.whl).

4. Wait for the installation to complete.

Note: I have tried many methods at this time, so I have downloaded cmake, boost and c++. If you fail to use this method, it may be because you did not download these.

The second one (I didn’t succeed)

Direct pip installation

I entered pip install dlib in the terminal, but I did not succeed (an error occurred after the download was completed and the subsequent steps were reported)

Provide a Tsinghua source mirror URL, which can be downloaded faster:
pip install dlib -i https://pypi.tuna.tsinghua.edu.cn/simple

The third type (I did not succeed)

Download the dlib file from the official website and run setup.py

1. Download from the official website , such as dlib-19.17.zip, and unzip it for later use.

2. Download cmake, pip install cmake. (-i https://pypi.tuna.tsinghua.edu.cn/simple)

3. Download boost, pip install boost. (-i https://pypi.tuna.tsinghua.edu.cn/simple)

4. In the terminal, jump to the folder decompressed in step 1 (cd D:\...), and then run python setup.py install

The fourth one (I didn’t succeed)

Need to download C++

1. Download Visual Studio from the official website and install it in "Single Component" during the installation process.MSVC v142 - VS 2019 C++ x64/x86 build toolandWindows 10 SDK (10.0.20348.0)
Insert image description here
2. Add the file directory to the Path environment directory, such as...\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86

3. Download cmake, pip install cmake. (-i https://pypi.tuna.tsinghua.edu.cn/simple)

4. Download Dlib, pip install dlib. (-i https://pypi.tuna.tsinghua.edu.cn/simple)
(I think this method works for others, but I still get an error after using it)
Insert image description here

Guess you like

Origin blog.csdn.net/damogu_lv/article/details/135410026