AttributeError: module 'cv2' has no attribute 'face' (OpenCV and Python)
up vote
1
down vote
favorite
I have been trying a lot of things like reinstalling CV2, but this error will not go away.
This is the code:
import cv2
import numpy as np
from PIL import Image
import os
# Path for face image database
path = 'C:\Users\lordg_000\Desktop\trainer'
recognizer = cv2.face.LBPHFaceRecognizer_create()
detector = cv2.CascadeClassifier("haarcascade_frontalface_default.xml");'
python cv2
add a comment |
up vote
1
down vote
favorite
I have been trying a lot of things like reinstalling CV2, but this error will not go away.
This is the code:
import cv2
import numpy as np
from PIL import Image
import os
# Path for face image database
path = 'C:\Users\lordg_000\Desktop\trainer'
recognizer = cv2.face.LBPHFaceRecognizer_create()
detector = cv2.CascadeClassifier("haarcascade_frontalface_default.xml");'
python cv2
Which version of OpenCV are you using?
– Employee
Nov 11 at 12:07
the version is 3.4.3.18
– Cactus882
Nov 11 at 22:49
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have been trying a lot of things like reinstalling CV2, but this error will not go away.
This is the code:
import cv2
import numpy as np
from PIL import Image
import os
# Path for face image database
path = 'C:\Users\lordg_000\Desktop\trainer'
recognizer = cv2.face.LBPHFaceRecognizer_create()
detector = cv2.CascadeClassifier("haarcascade_frontalface_default.xml");'
python cv2
I have been trying a lot of things like reinstalling CV2, but this error will not go away.
This is the code:
import cv2
import numpy as np
from PIL import Image
import os
# Path for face image database
path = 'C:\Users\lordg_000\Desktop\trainer'
recognizer = cv2.face.LBPHFaceRecognizer_create()
detector = cv2.CascadeClassifier("haarcascade_frontalface_default.xml");'
python cv2
python cv2
edited Nov 11 at 6:24
Dave W. Smith
15.9k22430
15.9k22430
asked Nov 11 at 4:11
Cactus882
92
92
Which version of OpenCV are you using?
– Employee
Nov 11 at 12:07
the version is 3.4.3.18
– Cactus882
Nov 11 at 22:49
add a comment |
Which version of OpenCV are you using?
– Employee
Nov 11 at 12:07
the version is 3.4.3.18
– Cactus882
Nov 11 at 22:49
Which version of OpenCV are you using?
– Employee
Nov 11 at 12:07
Which version of OpenCV are you using?
– Employee
Nov 11 at 12:07
the version is 3.4.3.18
– Cactus882
Nov 11 at 22:49
the version is 3.4.3.18
– Cactus882
Nov 11 at 22:49
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The extension module Opencv_contrib is not installed.
Solution:
pip uninstall opencv-python
pip install opencv-contrib-python
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
you don't need to uninstallopencv-python
. Onlypip install opencv-contrib-python
should work for you.
– Sociopath
Nov 12 at 11:23
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The extension module Opencv_contrib is not installed.
Solution:
pip uninstall opencv-python
pip install opencv-contrib-python
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
you don't need to uninstallopencv-python
. Onlypip install opencv-contrib-python
should work for you.
– Sociopath
Nov 12 at 11:23
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
add a comment |
up vote
0
down vote
The extension module Opencv_contrib is not installed.
Solution:
pip uninstall opencv-python
pip install opencv-contrib-python
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
you don't need to uninstallopencv-python
. Onlypip install opencv-contrib-python
should work for you.
– Sociopath
Nov 12 at 11:23
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
add a comment |
up vote
0
down vote
up vote
0
down vote
The extension module Opencv_contrib is not installed.
Solution:
pip uninstall opencv-python
pip install opencv-contrib-python
The extension module Opencv_contrib is not installed.
Solution:
pip uninstall opencv-python
pip install opencv-contrib-python
edited Nov 12 at 11:21
answered Nov 11 at 12:35
myhaspldeep
16017
16017
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
you don't need to uninstallopencv-python
. Onlypip install opencv-contrib-python
should work for you.
– Sociopath
Nov 12 at 11:23
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
add a comment |
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
you don't need to uninstallopencv-python
. Onlypip install opencv-contrib-python
should work for you.
– Sociopath
Nov 12 at 11:23
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
it says Requirement already satisfied
– Cactus882
Nov 11 at 22:48
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
Uninstall before installing.
– myhaspldeep
Nov 12 at 11:12
you don't need to uninstall
opencv-python
. Only pip install opencv-contrib-python
should work for you.– Sociopath
Nov 12 at 11:23
you don't need to uninstall
opencv-python
. Only pip install opencv-contrib-python
should work for you.– Sociopath
Nov 12 at 11:23
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
None of the solutions here worked
– Cactus882
Nov 13 at 1:47
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245773%2fattributeerror-module-cv2-has-no-attribute-face-opencv-and-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Which version of OpenCV are you using?
– Employee
Nov 11 at 12:07
the version is 3.4.3.18
– Cactus882
Nov 11 at 22:49