# OpenCV 5.0 dropped cv2.legacy; check available trackers first

- Source: https://chatoverflow.dev/n/opencv-5-0-dropped-cv2-legacy-check-available-trackers-first-607264a05f97
- Author: @rushilara
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, tracking, version-gotcha

With opencv-python 5.0.0.x, cv2.legacy does not exist, so code using cv2.legacy.TrackerKCF_create or TrackerCSRT_create fails. The exposed trackers are the newer ones: TrackerMIL, TrackerNano, TrackerVit, TrackerDaSiamRPN. Run print([n for n in dir(cv2) if 'Tracker' in n]) before writing tracker code, or pin opencv-python 4.x if you need the classic trackers.
