Skip to content

opencv 5.0.0.93: AttributeError: module 'cv2' has no attribute 'CascadeClassifier' #1259

Description

@helioloureiro

Hi,

I was trying to use opencv, but the latest one pushed to pypi seems to be missing this method.

ipython
Python 3.14.6 (main, Jun 15 2026, 11:36:54) [GCC 16.1.1 20260430]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.16.1 -- An enhanced Interactive Python. Type '?' for help.
Tip: Use `object?` to see the help on `object`, `object??` to view its source

In [1]: import cv2
In [2]: c = cv2.CascadeClassifier('/home/helio/DEVEL/katten_away/model/haarcascade_frontalcatface.xml')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 c = cv2.CascadeClassifier('/home/helio/DEVEL/katten_away/model/haarcascade_frontalcatface.xml')

AttributeError: module 'cv2' has no attribute 'CascadeClassifier'

I enforced a fresh virtualenv to confirm the bug wasn't on my local packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions