Skip to content

Installation fails on a fresh Debian 12 - pip3 #6

@jacen05

Description

@jacen05

On line 25 of file install_modules/shared/impulse_deps.sh there is the following command for ubuntu, debian and linuxmint:

pip3 install --upgrade pip setuptools

This does not work on Debian 12 with default python 3.11.2

I get the following error:

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.11/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.

The best way to correct that is to (in order of preference):

  • use Python system packages, but it's complicated for your script as you don't control APT sources, already installed packages, weither the pip packages you need are available as system packages ... so better to go the second point, pipx
  • use pipx instead of pip, as it will manage the creation of the venv
  • use pip3 but do the venv creation yourself

As I don't know in how many files you're using pip3 (at least in install_modules/manager/impulse_aux.sh and in install_modules/shared/pip_venv.sh), I got away with the command:

mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old

However this is obviously not the best way to do it.
Don't do this on a production system relying on python packages!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions