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

install_prereq.sh needs --break-system-packages on Debian 12 (or another environment) #1143

Open
Auravendill opened this issue Nov 12, 2024 · 9 comments

Comments

@Auravendill
Copy link

Auravendill commented Nov 12, 2024

The install script tries to install python packages in the default environment, which is also the one apt installs to. Since Debian 12 this environment is a bit protected, so any pip install without explicit "--break-system-packages" will just fail.

This is the output, when it fails:

0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
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.
@ybungalobill
Copy link

Also happens for me on Arch (up-to-date at the time of writing).

@sparkydave1981
Copy link

I just tried to install on a new machine and got the same issue. Is there a work-around?

@themahdin
Copy link

same here...

@tlghndeniz
Copy link

Use:

  1. Open Terminal
  2. Run sudo nano /etc/pip.conf
  3. Add following line:
[global]
break-system-packages = true

@suchoi31
Copy link

Same issue here.
Typing "sudo nano /etc/pip.conf" will lead to the following message in the console (putty) "sudo nano /etc/pip.conf: command not found"

Hope anyone can help fixing this issue.

@tlghndeniz
Copy link

tlghndeniz commented Nov 24, 2024

Same issue here. Typing "sudo nano /etc/pip.conf" will lead to the following message in the console (putty) "sudo nano /etc/pip.conf: command not found"

Hope anyone can help fixing this issue.

  1. Check If nano Is Installed
    Run the following command to check if nano is available:

which nano

  • If it outputs a path (e.g., /usr/bin/nano), nano is installed, but there might be another issue.
  • If no output is displayed, it means nano is not installed.
  1. Install nano
    If nano is not installed, install it using your system's package manager:
  • For Debian/Ubuntu-based systems:
sudo apt update
sudo apt install nano

@suchoi31
Copy link

Thank you for the hint. Nano was already there. I reinstall it, add the line mentioned in your previous comment "break-system-packages = true", and now the "sudo ./install_prereq.sh" request works.

Thanks a lot!!! @tlghndeniz

@h4de5
Copy link

h4de5 commented Nov 30, 2024

just run into this issue as well.

sudo su
python3 -m pip config set global.break-system-packages true
./install_prereq.sh

will install it. (obviously not recoomended if you are caring about that system)

@tylertylerday
Copy link

I used the break-system-packages method and at the end of installing requirements it gives a warning about "Running pip as the 'root' user can result in broken permissions...etc"

Should I be worried about that?

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

8 participants