Skip to content

Conversation

@ghostinthefingers
Copy link
Contributor

Fix installation on modern Python with externally-managed environments

This patch updates the gef-extras.sh script to handle Python’s externally-managed environments (common on recent Debian/Ubuntu systems). The installer now:

  1. Tries a normal pip install first.
  2. Detects if the failure is due to externally-managed-environment.
  3. Automatically retries with --break-system-packages if needed.
  4. Exits with a clear error message for other pip failures.

without this fix, the installation fails on modern Python systems with the following error:

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install ...

@github-actions
Copy link

🤖 Coverage update for 322df53 🟢

Old New
Commit 60a99cb 322df53
Score 71.0582% 71.0582% (0)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the gef-extras.sh installer to handle pip installs on systems enforcing Python “externally-managed environments” (PEP 668), retrying with --break-system-packages when that specific failure is detected.

Changes:

  • Capture pip install output to detect externally-managed-environment failures.
  • Retry installation with --break-system-packages when that failure occurs.
  • Print a clearer error message and exit for non-PEP-668 pip failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hugsy hugsy merged commit 4ce50e3 into hugsy:main Feb 1, 2026
11 of 13 checks passed
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.

2 participants