fix(kb): re-exec python shims under .venv when ladybug is missing - #41
Merged
Conversation
bin/brain/index.go --rebuild (-> bin/kb/index) failed on hosts where system python3 lacks ladybug/model2vec. kblib now re-execs itself via the repo .venv python when the active interpreter cannot import ladybug, so the documented workflow works without activating the venv first. Docker index image (PATH python3 has ladybug) is unaffected.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem — Step 3 of the mail→brain workflow,
bin/brain/index.go --rebuild, failed on this host withModuleNotFoundError: No module named 'ladybug'. The python shims (bin/kb/index, bin/kb/add, ...) shebang to#!/usr/bin/env python3, which resolves to system python3 without the project deps (ladybug/model2vec live in.venv/).Fix — bin/tools/kblib.py now re-execs the running script under
<repo>/.venv/bin/python3when the active interpreter cannot import ladybug. The Docker index image keeps python3 with ladybug on PATH, so the block is skipped there. Verified:bin/brain/index.go --dry-run --with-facts --with-chatsworks without activating the venv--rebuild: 16702 info + 9 facts in 4m11s