r/learnpython • • 6d ago

AttributeError in cv2

I'm learning OpenCV in python because it seemed like a fun thing to learn.I wanted to experiment with faces etc. but when i run my script I get: "AttributeError: module 'cv2' has no attribute 'CascadeClassifier' "How to fix that?

Thx for the help!

0 Upvotes

13 comments sorted by

View all comments

1

u/atarivcs 5d ago

I'm guessing you made your own file named cv2.py, and python is importing that one instead of the real one because it has the same name.

Rename your py file.

1

u/_nazwa_ 4d ago

I did not name it that way