Skip to content

Makefile use venv by default enforce PEP 668#134

Open
RubenVP2 wants to merge 2 commits into
calesthio:mainfrom
RubenVP2:main
Open

Makefile use venv by default enforce PEP 668#134
RubenVP2 wants to merge 2 commits into
calesthio:mainfrom
RubenVP2:main

Conversation

@RubenVP2

@RubenVP2 RubenVP2 commented Jun 22, 2026

Copy link
Copy Markdown

Modern Debian/Ubuntu systems enforce PEP 668, which blocks pip install system-wide to prevent breaking the OS-managed Python environment.

Current OS :
{F526AF15-E71A-42F1-826B-FA9D21C4D517}

Error :

~/workspace/OpenMontage$ make setup
==> Installing Python dependencies...
pip install -r requirements.txt
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.13/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
make: *** [Makefile:7: setup] Error 1

Fix: Updated the Makefile to automatically create a .venv virtual environment and use it for all Python operations.

Changes:

  • Added VENV, PYTHON, and PIP variables pointing to .venv/bin/
  • setup now creates venv if it doesn't exist (python3 -m venv venv) before installing
  • All python and pip calls across every target now use the venv binaries
  • install, install-dev, install-gpu also auto-create the venv if missing

@RubenVP2 RubenVP2 requested a review from calesthio as a code owner June 22, 2026 18:01
@RubenVP2 RubenVP2 changed the title Modern Debian/Ubuntu systems enforce PEP 668, which blocks pip install system-wide to prevent breaking the OS-managed Python environment. Makefile use venv by default enforce PEP 668 Jun 24, 2026
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.

1 participant