{"record":{"id":"28255d6b23099488","repo":"matplotlib/matplotlib","slug":"failed-to-determine-the-version-of-args-0-from","errorCode":null,"errorMessage":"Failed to determine the version of {args[0]} from {' '.join(args)}, which output {output}","messagePattern":"Failed to determine the version of (.+?) from (.+?), which output (.+?)","errorType":"exception","errorClass":"ExecutableNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/matplotlib/__init__.py","lineNumber":428,"sourceCode":"                output = _cpe.output\n            else:\n                raise ExecutableNotFoundError(str(_cpe)) from _cpe\n        except subprocess.TimeoutExpired as _te:\n            msg = f\"Timed out running {cbook._pformat_subprocess(args)}\"\n            raise ExecutableNotFoundError(msg) from _te\n        except OSError as _ose:\n            raise ExecutableNotFoundError(str(_ose)) from _ose\n        match = re.search(regex, output)\n        if match:\n            raw_version = match.group(1)\n            version = parse_version(raw_version)\n            if min_ver is not None and version < parse_version(min_ver):\n                raise ExecutableNotFoundError(\n                    f\"You have {args[0]} version {version} but the minimum \"\n                    f\"version supported by Matplotlib is {min_ver}\")\n            return _ExecInfo(args[0], raw_version, version)\n        else:\n            raise ExecutableNotFoundError(\n                f\"Failed to determine the version of {args[0]} from \"\n                f\"{' '.join(args)}, which output {output}\")\n\n    if name in os.environ.get(\"_MPLHIDEEXECUTABLES\", \"\").split(\",\"):\n        raise ExecutableNotFoundError(f\"{name} was hidden\")\n\n    if name == \"dvipng\":\n        return impl([\"dvipng\", \"-version\"], \"(?m)^dvipng(?: .*)? (.+)\", \"1.6\")\n    elif name == \"gs\":\n        execs = ([\"gswin32c\", \"gswin64c\", \"mgs\", \"gs\"]  # \"mgs\" for miktex.\n                 if sys.platform == \"win32\" else\n                 [\"gs\"])\n        for e in execs:\n            try:\n                return impl([e, \"--version\"], \"(.*)\", \"9\")\n            except ExecutableNotFoundError:\n                pass\n        message = \"Failed to find a Ghostscript installation\"","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/matplotlib/matplotlib/blob/b379c1b69e012b142c0f496a52bcb30513802d72/lib/matplotlib/__init__.py#L410-L446","documentation":"Affine2DBase declares transform_affine() as the abstract hook that concrete affine transforms must supply; the base implementation only raises NotImplementedError('Affine subclasses should override this method.'). You hit it when an affine transform object actually executes - the error surfaces from transform()/transform_path() too, since they delegate to transform_affine().","triggerScenarios":"Subclassing Affine2DBase (instead of Affine2D) and overriding get_matrix() but not transform_affine(); instantiating an intermediate affine base class directly (Affine2DBase(), or an unfinished subclass) and calling .transform(points) on it; tests that instantiate every class in a hierarchy.","commonSituations":"Writing custom affine transforms (e.g. a lazily-updated matrix cache) while subclassing the wrong base; partially-copied subclass code from matplotlib internals that skips the method; tutorial code that subclasses Affine2DBase to hook get_matrix.","solutions":["Subclass Affine2D and override get_matrix() only - Affine2D already implements transform_affine via the matrix machinery","If you must subclass Affine2DBase, implement transform_affine(values) returning the (N, 2) result of applying your 3x3 matrix","Never instantiate Affine2DBase or half-finished subclasses; guard with a factory that asserts the override exists"],"exampleFix":"// before\nclass MyAffine(mtrans.Affine2DBase):\n    def get_matrix(self): return self._mtx\na = MyAffine(); a.transform(pts)  # NotImplementedError\n\n// after\nclass MyAffine(mtrans.Affine2D):\n    def get_matrix(self): return self._mtx\na = MyAffine(); a.transform(pts)","handlingStrategy":"type-guard","validationCode":"import inspect\nfor m in ('transform_affine', 'get_matrix'):\n    owner = inspect.getmro(type(affine))\n    assert any(m in vars(c) for c in owner if c is not mtrans.Affine2DBase), f'{type(affine).__name__} must override {m}'","typeGuard":"def is_concrete_affine(t) -> bool:\n    return isinstance(t, mtrans.Affine2D) or type(t).transform_affine is not mtrans.Affine2DBase.transform_affine","tryCatchPattern":"try:\n    out = affine.transform(pts)\nexcept NotImplementedError as e:\n    if 'Affine subclasses' in str(e):\n        raise TypeError(f'{type(affine).__name__} is not a concrete affine') from e\n    raise","preventionTips":["Subclass Affine2D, not Affine2DBase, for custom affines","Never instantiate base/intermediate classes directly","Unit-test that custom transforms transform at least one point"],"tags":["matplotlib","transforms","affine","abstract-method","not-implemented"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"b379c1b69e012b142c0f496a52bcb30513802d72","analyzedAt":"2026-08-21T23:31:55.468Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}