I have installed dlib library successfully for python 3.10.4 on my computer using the traditional pip command. But after installing now I am trying to import the same and it is throwing error. Please help me out on the same.enter image description here
Asked
Active
Viewed 2,221 times
-2
-
1Please note, that Stack Overflow discourages using **images** which represent **text**. Instead paste the code and the error messages directly into the question post, see [ask]. BTW, on the first image you have imported statement only **highlighted** by IDE (VSCode in your case). Have you actually tried to **run** your code? IDE highlighting doesn't mean the code cannot be run. – Tsyvarev Apr 10 '22 at 21:17
2 Answers
-1
The solution for my problem was....
- install cmake (pip install cmake)
- install wheel (pip install wheel)
- install dlib (pip install dlib)
- set the interpreter to correct version of python (in my case vs code was using python 3.9 and I have installed dlib on 3.10.... then I changed the interpreter to 3.10 and then it worked for me)

Naveena Poojari
- 1
- 5
-1
In my case, the problem has been solved by setting properly the PATH for the Python Interpreter. If you want to check or give it a try to this, check bellow how you can do that.
If you run VSCode on Windows go to:
- File
- Preferences
- Settings
- User (tab on the top left)
- Extensions (side column)
- Python
- Default Interpreter Path (section, on the right side)
Insert your Python Interpreter Path. In my case it is "C:\Users\userName\AppData\Local\Programs\Python\Python310", check yours. Hope that helps.

Victor
- 1
- 4