Skip to content

fix: use sys.executable instead of hardcoded 'python' for subprocess calls#551

Open
desmonna wants to merge 1 commit into
lsdefine:mainfrom
desmonna:fix/venv-executable
Open

fix: use sys.executable instead of hardcoded 'python' for subprocess calls#551
desmonna wants to merge 1 commit into
lsdefine:mainfrom
desmonna:fix/venv-executable

Conversation

@desmonna
Copy link
Copy Markdown
Contributor

@desmonna desmonna commented Jun 1, 2026

Problem

On Windows with multiple Python installations (e.g. system Python + venv),
hardcoded "python" in subprocess calls resolves to the system default
via PATH, not the active venv interpreter. This causes child processes to
miss all venv-installed packages (PyQt5, Textual, pywebview, etc.), resulting
in ModuleNotFoundError on startup.

Fix

Replace all 10 occurrences of ["python", ...] with [sys.executable, ...].

sys.executable returns the absolute path of the currently running Python
interpreter
, guaranteeing child processes inherit the same venv environment.
This is the officially recommended approach for cross-platform compatibility.

Changes

File Count What
ga_cli/cli.py 7 All CLI command entries (gui, configure, hub, tui, tui2, cli, launch)
memory/checklist_helper.py 3 BBS subprocess, worker reflection, master reflection

Testing

  • Verified ga gui, ga tui, ga cli launch correctly under venv
  • Verified checklist helper BBS/worker/master subprocesses start with correct environment

Fixes #501

…calls

On Windows with multiple Python installations, hardcoded 'python' resolves
to the system default (via PATH) rather than the active venv interpreter.
This causes subprocess-spawned children to miss venv-installed packages.

Replace all 10 occurrences of ["python", ...] with [sys.executable, ...]:
- ga_cli/cli.py: 7 command entries (gui, configure, hub, tui, tui2, cli, launch)
- memory/checklist_helper.py: 3 subprocess.Popen calls (bbs, worker, master)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix:针对多个python版本存在,完善cli命令启动的subagent继承当前GA目录环境,而不是系统默认python

1 participant