0

So I am doing a face recognition project in a Raspberry Pi. It is a django project and when I run the server I get this error: AttributeError: module 'cv2' has no attribute 'face'

I searched for the error and I came up with that I needed to install opencv-contrib-python

The problem is that when I try to install it the download gets to 99% and I get this: 'pip3 install opencv-contrib-pyt…' terminated by signal SIGKILL (Forced quit).

Does anyone know why this happens? how can I fix this? help is much appreciated

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
eneko valero
  • 457
  • 3
  • 14
  • 1
    Try installing the headless version, `opencv-contrib-python-headless`? – Iain Shelvington Jan 01 '22 at 11:57
  • 1
    remove **everything** related to opencv. all the pip packages you might have, all the apt/yum/whatever packages, everything. then install **only** `opencv-contrib-python` or its headless variant, not both, and not the non-contrib packages either. and check your disk usage and ram usage. if your disk is full, we can't help with that. -- and why did you tag `django`? that's irrelevant here. – Christoph Rackwitz Jan 01 '22 at 14:02

1 Answers1

-2

I got the same error and fixed it like this.

Try:

  1. sudo apt install python-opencv libopencv-dev

  2. y/n --> y

  3. sudo apt install python python-pip

  4. y/n --> y

  5. pip install opencv-python

Abdullah
  • 65
  • 1
  • 9
  • thank you, but does not work for me, I still get: AttributeError: module 'cv2' has no attribute 'face' – eneko valero Jan 01 '22 at 12:52
  • 1
    Maybe this page can help you: ( https://stackoverflow.com/questions/44633378/attributeerror-module-cv2-cv2-has-no-attribute-createlbphfacerecognizer) – Abdullah Jan 01 '22 at 13:21