fix(ga_cli): use sys.executable instead of hardcoded 'python' to inherit venv environment#502
Open
desmonna wants to merge 1 commit into
Open
fix(ga_cli): use sys.executable instead of hardcoded 'python' to inherit venv environment#502desmonna wants to merge 1 commit into
desmonna wants to merge 1 commit into
Conversation
…rit venv environment
Contributor
|
感谢~不过
你 fork 的可能是更早的快照。先关掉这条~ |
Contributor
Author
我fork的是昨天的仓库,算是比较新的。主要是昨天agent窗口执行任务时提示subagent缺少依赖而跳过任务,我发现142行 pip install 用 sys.executable ,但是前面第51行 —— 启动GUI却用硬编码 "python"。fork 出的子进程用的是 "python"(PATH 上的系统 Python),系统 Python 没有装那些依赖 → 报错缺包。所以才针对这个问题做了修改。 |
Contributor
Author
|
因为我的电脑上有几个不同的python版本,而运行GA安装依赖的也不是PATH中的python,所以遇到了这个问题 |
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:
All subcommands in ga_cli/cli.py (gui, configure, hub, tui, tui2, cli, launch) use hardcoded "python" to start processes. This can cause sub-processes to use the system global Python instead of the currently active environment's Python when running in a virtual environment (venv/conda), and thus fail to find installed dependency packages.
Solution
Replace all "python" with sys.executable to ensure that child processes inherit the current Python interpreter path.
Changes
ga_cli/cli.py: 7 occurrences of "python" → sys.executable
Fixes #501