Fix pip Externally Managed Environment on Debian 12 - Fix 'git remote origin already exists' Error on Mac-Prevent Git Index Lock File Creation: Practical Fixes

Result check
- Keep one change per test run so you know which step helped.
- Undo temporary changes after the issue is confirmed.