Attention! This forum will be made read-only by Dec-20. Please migrate to Most of existing active users should've received invitation by e-mail.
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Opencv3 and Python 2.7 on Virtual Enviorement - AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

I have python function with opencv 3. it is normally working without virtual enviorement.Also I installed opencv on venv from:pyimagesearch. i am trying to run that python function on venv, then it is getting error :

AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

without venv in terminal:

gkhan@Gkan ~/Masaüstü/face_recognizer $ python
Yol :./sinif/114.jpg.
114 Yuz Tanindi 12

with venv in terminal:

gkhan@Gkan ~/Masaüstü/face_recognizer $ workon cv
(cv)gkhan@Gkan ~/Masaüstü/face_recognizer $ python
Traceback (most recent call last):
  File "", line 15, in <module>
    recognizer = cv2.createLBPHFaceRecognizer()
AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

my python codes:

# -*- coding: utf-8 -*-

    import cv2, os
    import numpy as np
    from PIL import Image

    # For Test
    if 0==0:

        cascadePath = "haarcascade_frontalface_default.xml"
        faceCascade = cv2.CascadeClassifier(cascadePath)

        recognizer = cv2.createLBPHFaceRecognizer()

Linux Mint 64 Bit, Opencv3, python2.7