pythonpython-3.xpython-imaging-librarydlibpython-install

import dlib ModuleNotFoundError: No module named 'dlib' in python IDLE


I have installed dlib using Anaconda 3 prompt. It has shown me that it got installed successfully. I checked through command import dlib it did not give me any error even I checked the version also it came up with 19.9.0.

But when I open my program in IDLE and run the program its showing me error

import dlib ModuleNotFoundError: No module named 'dlib'

Even from command prompt, I am getting same error.

What is the issue? I am using Python 3.6.

Installation process of dlib using anaconda3:

Installation process of <code>dlib</code>


Solution

  • Extending @Rohit's answer:

    As you have installed dlib in Anaconda, you need to run the program using Anaconda prompt.

    By default, IDLE and python command in command prompt use Python that is installed system wide (which is Python 3.6.0 in your case).

    But to use dlib which is installed in Anaconda's virtual environment (env_dlib) you need to do:

    1. Open Anaconda prompt.
    2. Activate env_dlib environment: activate env_dlib
    3. Run the Python file which uses dlib package: python FILENAME