Scene Reproduction:Because you need to use dlib+face_recognition to do some face recognition projects based on OpenCV, when you download and install pip Tsinghua source in Pycharm, there is an error in the figure below and the installation fails.
pip install -i /simple dlib
Report an error:Unable to install face detection dlib library.
rationale: python install face_recognition library face_recognition easy to error, need to rely on the dlib library, but generally people pip install dlib will error, because theMismatch between dlib library version and python version。
The dlib library is a Python library for face keypoint detection, but because it is written in C++ (or requires a C++ compiler?), it can be difficult to install. , you may encounter various problems when installing it.
Pro-tested and effective solution: whl installation method
Note that only certain versions are supported, so please check that the version supported by pip is the same!
(1) Check the version of Python on your computer, then download the .whl file of the corresponding dlib library and put it in the directory you want to install or in the virtual environment package directory.
The corresponding version of the whl file is linked below:
Python 3.6 corresponds to the .whl file link:dlib-19.6.0-cp36-cp36m-win_amd64.whl
Python 3.7 corresponds to the .whl file link:dlib-19.17.99-cp37-cp37m-win_amd64.whl
Link to Python 3.9 counterpart .whl file:dlib-19.22.99-cp39-cp39-win_amd64
Once the download is complete, you can install the .whl file directly from Pycharm.
Here, my Python version is 3.9, so I should look for the version of dlib that corresponds to Python 3.so click for the link to download the corresponding .whl file for Python 3.9.
(2) After extracting the package, you can see the whl file.
First, change the name of the whl file by removing the trailing (2) and replacing it with pip install dlib-19.22.99-cp39-cp39-win_amd64.whl.
(3) Enter pycharm and open the terminal termal, first go to the file path where the whl file is located, and then enter the command.
pip install dlib-19.22.99-cp39-cp39-win_amd64.whl
As you can see from the picture, the dilb library has been installed successfully.
(4) Having successfully installed the dlib library, let's try installing the face_recognition library by running the following command in a terminal.
pip install -i /simple face_recognition
As can be seen.
The face_recognition third-party package also installed successfully without any problems.
to this article on Python dilb and face_recognition third-party package installation failed to solve the article is introduced to this, more related Python third-party package installation failed to search for my previous posts or continue to browse the following related articles I hope you will support me in the future more!