These instructions assume you are on macOS, but basically the same on Linux.
Pre-reqs:
brew install boost-python --with-python3 --without-python
sudo apt-get install libboost-all-dev
Clone the code from github:
git clone https://github.com/davisking/dlib.git
Build the main dlib library:
cd dlib
mkdir build; cd build; cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1; cmake --build .
Build and install the Python extensions:
cd ..
python3 setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA
At this point, you should be able to run python3
and type import dlib
successfully.