Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on a fresh Debian 12 - pip3 #6

Open
jacen05 opened this issue Apr 7, 2024 · 3 comments
Open

Installation fails on a fresh Debian 12 - pip3 #6

jacen05 opened this issue Apr 7, 2024 · 3 comments

Comments

@jacen05
Copy link

jacen05 commented Apr 7, 2024

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!

@bgenev
Copy link
Owner

bgenev commented Apr 10, 2024

Will investigate, haven't tested on Debian 12. It does create a new venv at the start of the build.

These versions work fine, you can use them:

Debian 10,11
Ubuntu LTS 22.04, 20.04

@TheLinuxGuy
Copy link

I have been able to reproduce this bug on LXC container under proxmox 8.1. Install fails.

Processing triggers for libc-bin (2.36-9+deb12u4) ...
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.
root@impulse:/opt/impulse# date
Sat Apr 20 17:52:11 UTC 2024
root@impulse:/opt/impulse#

@TheLinuxGuy
Copy link

These versions work fine, you can use them:

Debian 10,11 Ubuntu LTS 22.04, 20.04

If this project has only been tested under these linux flavors and specific versions, could you please make that clear in the documentation?

There are blurbs in different places that the agent can run with 1.5GB of ram and 1 core VPS. But that did not mention if its for the light agent or the "heavy" agent. So I think there should be a "Systems Requirements and scale" page of sorts and there a disclaimer could exist about untested platforms. My 2c

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

No branches or pull requests

3 participants