Issue: ga script should prefer project's .venv over system python
Problem
The ga launcher script currently uses python from PATH, which may point to system python. This causes issues on systems with Homebrew Python (macOS) due to PEP 668 protection:
- When running
ga update, it executes pip install -e . using system python
- Homebrew Python blocks this with:
error: externally-managed-environment
- Users must use
--break-system-packages, which pollutes system python
Current Behavior
File: ga
#!/usr/bin/env bash
cd "$(dirname "$0")"
exec python -m ga_cli "$@"
- Uses
python from PATH (often system python)
- Project dependencies are in
.venv but not accessible
ga update fails with PEP 668 error
Expected Behavior
The ga script should:
- Prefer
.venv/bin/python if it exists
- Fall back to
python from PATH if no venv
Proposed Solution
Modify ga script:
#!/usr/bin/env bash
cd "$(dirname "$0")"
if [ -x .venv/bin/python ]; then
exec .venv/bin/python -m ga_cli "$@"
else
exec python -m ga_cli "$@"
fi
Benefits
- ✅ Respects project's virtual environment
- ✅ Avoids polluting system python
- ✅
ga update works without --break-system-packages
- ✅ Follows Python best practices
- ✅ Compatible with PEP 668 (Homebrew Python)
Environment
- OS: macOS (Homebrew Python 3.14)
- Python: System python 3.14, project .venv python 3.12
- Error:
externally-managed-environment when running ga update
Workaround (Current)
Manually update in venv:
cd /path/to/GenericAgent
git pull
.venv/bin/pip install -e .
Related
Issue:
gascript should prefer project's .venv over system pythonProblem
The
galauncher script currently usespythonfrom PATH, which may point to system python. This causes issues on systems with Homebrew Python (macOS) due to PEP 668 protection:ga update, it executespip install -e .using system pythonerror: externally-managed-environment--break-system-packages, which pollutes system pythonCurrent Behavior
File:
gapythonfrom PATH (often system python).venvbut not accessiblega updatefails with PEP 668 errorExpected Behavior
The
gascript should:.venv/bin/pythonif it existspythonfrom PATH if no venvProposed Solution
Modify
gascript:Benefits
ga updateworks without--break-system-packagesEnvironment
externally-managed-environmentwhen runningga updateWorkaround (Current)
Manually update in venv:
Related