{"record":{"id":"f38bd0977cd80441","repo":"AlexsJones/llmfit","slug":"llmfit-binary-not-found-at-candidate-this-may-i","errorCode":null,"errorMessage":"llmfit binary not found at {candidate}. This may indicate a corrupt or incomplete installation.","messagePattern":"llmfit binary not found at (.+?)\\. This may indicate a corrupt or incomplete installation\\.","errorType":"exception","errorClass":"BinaryNotFoundError","httpStatus":null,"severity":"error","filePath":"llmfit-python/src/llmfit/__init__.py","lineNumber":32,"sourceCode":"class LlmfitError(Exception):\n    \"\"\"Base class for llmfit exceptions.\"\"\"\n\n\nclass BinaryNotFoundError(LlmfitError):\n    \"\"\"Exception raised when the llmfit binary cannot be found.\"\"\"\n\n    def __init__(self, candidate: Path) -> None:\n        super().__init__(\n            f\"llmfit binary not found at {candidate}. This may indicate a corrupt or incomplete installation.\"\n        )\n\n\ndef find_llmfit_bin() -> Path:\n    \"\"\"Return the path to the llmfit binary installed with this package.\"\"\"\n    bin_name = \"llmfit.exe\" if sys.platform == \"win32\" else \"llmfit\"\n    candidate = Path(sysconfig.get_path(\"scripts\")) / bin_name\n    if not candidate.is_file():\n        raise BinaryNotFoundError(candidate)\n    return candidate\n","sourceCodeStart":14,"sourceCodeEnd":34,"githubUrl":"https://github.com/AlexsJones/llmfit/blob/acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe/llmfit-python/src/llmfit/__init__.py#L14-L34","documentation":"Runtime error from the installed Python package: find_llmfit_bin() in llmfit-python/src/llmfit/__init__.py locates the binary that the wheel placed via shared_scripts, using sysconfig.get_path('scripts')/llmfit (llmfit.exe on Windows). If that file is absent, BinaryNotFoundError is raised — the wheel design guarantees the binary lands in the scripts dir, so its absence means the installation is broken or the invocation bypassed it.","triggerScenarios":"Running `python -m llmfit` or `from llmfit import find_llmfit_bin` when: the package was installed into a different environment than the one running (venv mismatch); the scripts dir was pruned; the wheel was installed with a custom install scheme that relocates scripts; or the module is imported straight from a source checkout where no install ever copied the binary.","commonSituations":"IDE using a different interpreter than the venv where the wheel was installed; `uv run` vs activated venv discrepancies; pip install --user with a rewritten user scheme; Docker image layers that deleted bin/ contents; reinstalling the venv without reinstalling the package.","solutions":["Reinstall the package into the environment you are actually running: `python -m pip install --force-reinstall <wheel>` inside that venv","Verify where Python expects the binary: `python -c \"import sysconfig; print(sysconfig.get_path('scripts'))\"` and confirm llmfit/llmfit.exe is there","If running from a source checkout, do an editable install (`uv sync`) instead of importing the package directly from the tree"],"exampleFix":"# before\npython -m llmfit system\n# BinaryNotFoundError: llmfit binary not found at .venv/bin/llmfit\n\n# after\npython -m pip install --force-reinstall ./llmfit_python_wheel/*.whl\npython -m llmfit system","handlingStrategy":"try-catch","validationCode":"import sysconfig, sys\nfrom pathlib import Path\nname = \"llmfit.exe\" if sys.platform == \"win32\" else \"llmfit\"\nif not (Path(sysconfig.get_path(\"scripts\")) / name).is_file():\n    raise SystemExit(\"llmfit binary missing from scripts dir — reinstall the wheel into this environment\")","typeGuard":"def has_llmfit_binary() -> bool:\n    \"\"\"True when the packaged binary exists in this interpreter's scripts dir.\"\"\"\n    import sys, sysconfig\n    from pathlib import Path\n    name = \"llmfit.exe\" if sys.platform == \"win32\" else \"llmfit\"\n    return (Path(sysconfig.get_path(\"scripts\")) / name).is_file()","tryCatchPattern":"from llmfit import find_llmfit_bin, BinaryNotFoundError\ntry:\n    bin_path = find_llmfit_bin()\nexcept BinaryNotFoundError as e:\n    raise SystemExit(f\"{e} — reinstall with `python -m pip install --force-reinstall llmfit`\")","preventionTips":["Verify the interpreter matches the install target: `python -m pip install` from the same venv you run","After recreating a venv, always reinstall the package, not just re-point the IDE","Smoke-test installations with `python -m llmfit --version` in CI"],"tags":["python","packaging","runtime","virtualenv","missing-executable"],"backgroundTag":"missing-executable","analyzedSha":"acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe","analyzedAt":"2026-08-17T10:35:29.658Z","contentChangedAt":"2026-08-17T10:35:29.658Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}