If you have conda installed in your system then follow these steps:
- conda create -n py36 python=3.6
- activate py36
- conda config --add channels conda-forge
- conda install numpy
- conda install scipy
- conda install dlib
- pip install --no-dependencies face_recognition
If you have conda installed in your system then follow these steps:
- conda create -n py36 python=3.6
- activate py36
- conda config --add channels conda-forge
- conda install numpy
- conda install scipy
- conda install dlib
- pip install --no-dependencies face_recognition
First of all, install Cmake.
pip install cmake
After that, install the dlib.
If pip is not working, install dlib via the wheel file.
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
After that, you can install the face_regognition module.
pip install face_recognition
Fortunately, I solved the problem. These are the steps to download face_recognition Library:
1- install python:
in the command prompt write
pythonand click Enter, this will open Microsoft store for you, "click download" or "install" to download and install python. "to check if it is downloaded or not typepythonin the command prompt
2- install pip if you do not have it:
go to: https://pypi.org/project/pip-download/ click download files. Now open the downloaded file, then click right click with the mouse and choose "open in windows terminal". now type the command
python get-pip.py. now your pip should be installed, typepipin the terminal to check if it is installed
3-Install Visual Studio tools For C++
go to: https://visualstudio.microsoft.com/ and download the community version of VS. after downloading install it and choose the following options in the installation page:
image1 image2and choose install
4- installing cmake
Enter the command
pip install cmakeand wait fo it to be installed.
5- Add cmake to the Path variable
follow the instructions in the following link to know how to add something to your Path variable: https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
6- Install dlib
write the following command in the command prompt:
pip install dlib
7- install face_recognition
write the following command in the command prompt:
pip install face_recognition
8- start your project in PyCharm
click File click Sittings in the search type "interpreter" choose "python interpreter" choose "show all" click the "+" sign choose system Interpreter choose the interpreter that its path starts with the "users" directory
That is the solution I used to fix my problem
After doing all the steps described, I still get the following error:
Any help at all will be greatly appreciated!
Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: dlib
DEPRECATION: dlib is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
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
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\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.