- 1 year ago
Problem on installing dlib on windows 10(Cmake installed)
Installing dlib
on Windows 10 can sometimes be challenging due to dependencies and build requirements. Here's a general outline of the steps to install dlib
on Windows 10 using CMake:
Install CMake: Ensure that CMake is installed on your system. You can download the latest CMake version from the CMake website (https://cmake.org/download/) and install it.
Install Python and pip: If you haven't already, install Python and ensure that the
pip
package manager is available.Install required dependencies:
- OpenCV:
dlib
requires OpenCV. You can install it usingpip
:shellpip install opencv-python
- OpenCV:
Install
dlib
usingpip
:shellpip install dlib
This command will attempt to download and install the pre-built binary of
dlib
for your system. If it encounters any issues or if there isn't a pre-built binary available for your Python version and system configuration, it will attempt to builddlib
from source using CMake.If the installation fails due to missing dependencies or build issues, you may need to manually build
dlib
using CMake. Here are the steps to follow in that case:Clone the
dlib
repository from GitHub: Use the following command to clone the repository:shellgit clone https://github.com/davisking/dlib.git
Build
dlib
using CMake:Open a command prompt and navigate to the
dlib
directory.Create a
build
directory:shellmkdir build
cd build
Run CMake to configure the build:
shellcmake ..
Build
dlib
using the appropriate build command for your system. For example, on Windows, you can usecmake --build . --config Release
to build the release version ofdlib
.Once the build is complete, you should find the
dlib
library and associated files in the appropriate directory within thebuild
directory.
Install
dlib
usingpip
with the--no-index
and--find-links
options:shellpip install --no-index --find-links=path/to/build/directory dlib
Replace
path/to/build/directory
with the actual path to thebuild
directory you created during the CMake build step.
Following these steps should help you install dlib
on Windows 10 using CMake. However, keep in mind that there can be variations and dependencies specific to your system configuration. If you encounter any issues during the installation, refer to the dlib
documentation and the respective GitHub repository for additional troubleshooting guidance.