{"record":{"id":"fb054e977871fe0b","repo":"open-mmlab/mmdetection","slug":"lap-is-not-installed-please-insta","errorCode":null,"errorMessage":"lap is not installed,                 please install it by: pip install lap","messagePattern":"lap is not installed,                 please install it by: pip install lap","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"mmdet/models/trackers/byte_tracker.py","lineNumber":53,"sourceCode":"            - low (float): Threshold of the second matching. Defaults to 0.5.\n            - tentative (float): Threshold of the matching for tentative\n                tracklets. Defaults to 0.3.\n        num_tentatives (int, optional): Number of continuous frames to confirm\n            a track. Defaults to 3.\n    \"\"\"\n\n    def __init__(self,\n                 motion: Optional[dict] = None,\n                 obj_score_thrs: dict = dict(high=0.6, low=0.1),\n                 init_track_thr: float = 0.7,\n                 weight_iou_with_det_scores: bool = True,\n                 match_iou_thrs: dict = dict(high=0.1, low=0.5, tentative=0.3),\n                 num_tentatives: int = 3,\n                 **kwargs):\n        super().__init__(**kwargs)\n\n        if lap is None:\n            raise RuntimeError('lap is not installed,\\\n                 please install it by: pip install lap')\n        if motion is not None:\n            self.motion = TASK_UTILS.build(motion)\n\n        self.obj_score_thrs = obj_score_thrs\n        self.init_track_thr = init_track_thr\n\n        self.weight_iou_with_det_scores = weight_iou_with_det_scores\n        self.match_iou_thrs = match_iou_thrs\n\n        self.num_tentatives = num_tentatives\n\n    @property\n    def confirmed_ids(self) -> List:\n        \"\"\"Confirmed ids in the tracker.\"\"\"\n        ids = [id for id, track in self.tracks.items() if not track.tentative]\n        return ids\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/models/trackers/byte_tracker.py#L35-L71","documentation":"BYTETracker associates detections to tracks with linear assignment provided by the optional 'lap' package. If the lap import failed, constructing ByteTrack raises RuntimeError.","triggerScenarios":"Building BYTETracker (tracker=dict(type='ByteTrack', ...)) in an environment where 'import lap' fails or lap is not installed.","commonSituations":"Running MOT configs (bytetrack_yolox_x_8xb4-80e_mot17half...) after a base mmdet install; lap needs a C compiler and can fail to build on Windows or older pip.","solutions":["pip install lap","If the source build fails on Windows, install a prebuilt wheel: pip install lap -f https://github.com/gatagat/lap/releases or use conda","Verify with python -c 'import lap' in the same interpreter as training"],"exampleFix":"# before: RuntimeError: lap is not installed\n# after\npip install lap","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('lap') is None:\n    raise SystemExit('pip install lap')","typeGuard":null,"tryCatchPattern":"try:\n    tracker = ByteTracker(...)\nexcept RuntimeError as e:\n    if 'lap' in str(e):\n        raise SystemExit('Missing dependency: pip install lap')\n    raise","preventionTips":["Install tracking extras before running MOT configs","Pin a lap version that has prebuilt wheels for your platform"],"tags":["mmdetection","tracking","bytetrack","missing-dependency","lap"],"backgroundTag":"missing-python-package","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}