Skip to content

Tutorials

How to install Dlib for Python 3 on Windows

In this video we will see how to install the Dlib library for Python 3 on Windows.

In this specific tutorial we are going to install Dlib 19.8 for Python 3.6 (64 bit version). We choosed this specific version as it’s the latest one (March 2019 the moment I’m writing this post) which has ready binaries for windows.
In other words is the one that is really easy to install.

In this website you find all the binaries available at the moment:
https://pypi.org/simple/dlib/

If you don’t have Python and Opencv installed yet, go first with Python and Opencv installation following this tutorial.

Install Dlib for Python 3.6:

  1. Python 3.6 (64 bit) has to be already installed.
  2. Run Windows Prompt Command. You can type on the search bar “CMD”.

    Remember to click with right button of the mouse and then “Run it as administrator”, otherwise you might not have the permission to install the library.
  3. Type on the prompt command:
    python -m pip install https://files.pythonhosted.org/packages/0e/ce/f8a3cff33ac03a8219768f0694c5d703c8e037e6aba2e865f9bae22ed63c/dlib-19.8.1-cp36-cp36m-win_amd64.whl#sha256=794994fa2c54e7776659fddb148363a5556468a6d5d46be8dad311722d54bfcf
  4. Once you see the message “Successfully installed dlib“, it means that the installation has been completed.

You can now run Python, try importing the dlib library. If you don’t get any error, it means that the installation was done correctly.

29 comments

  1. Hi, thank for the tutorial
    i followed the same steps but i get this error :
    dlib-19.8.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

          1. uu have to download the wheel also of 32 bits bcoz uu are working on 32 bits python.

    1. The method I showed before only works with python 3.6 (64bits) at the moment.

      To install dlib for other versions of python you would need to compile the library yourself. I don’t have any tutorial about that at the moment.

  2. I uninstalled Python 3.7.3 and Successfully installed Python 3.6.8 and dlib-19.8.1
    But when calling dlib “import dlib”, I got the message “ImportError: numpy.core.multiarray could not import”

    Installing collected packages: dlib
    installed dlib-19.8.1

    >>> import dlib
    ImportError: numpy.core.multiarray failed to import

    1. Hi Hamdi!
      First, you need to install numpy! After that, it’ll works. Just follow this instruction: python -m pip install numpy.
      Please notice that you use the right python version. If you have python 3.7.x too in your computer, you should follow this command: py -3.6 -m pip install numpy

  3. when imported is shows like
    import dlib
    Traceback (most recent call last):
    File “”, line 1, in
    File “C:\Users\kishore\AppData\Local\Programs\Python\Python36\lib\site-packages\dlib\__init__.py”, line 1, in
    from .dlib import *
    ImportError: DLL load failed: The specified module could not be found.

  4. Worked perfectly, python 3.6 x64 is the key. This install method is so easy compared to building from source. Thank you very much!!!. Guys/Gals I see the same problem asked over and over in the comments. You need to follow directions and install python 3.6 x64. Then install numpy if needed. “python -m pip install numpy”. as per comment.

    Thank you so much!!!!!

  5. I am using python with 3.8.2 version, during dlib installation facing this error ” dlib-19.8.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform. “

Join the discussion