[Python] Is installing a python-based window manager such as Qtile in it's own local...

Discussão em 'Python' iniciado por Stack, Março 14, 2025.

  1. Stack

    Stack Membro Participativo

    Someone made a post asking how to fix this 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.
    ​

    ...in the past, and the suggestion from the top answer was that python libraries/applications are supposed to be installed in virtual environments whenever possible. While this is fine and dandy in the vast majority of situations, I am trying to install a tiling window manager called Qtile onto my Debian system. Since this sort of software generally requires root access to the system to function properly, is installing it in a separate environment really a good idea in this case? It does not sound like it. I am aware of other solutions like --break system-packages as the error itself mentions, but I really do not feel like causing issues with my system breaking if I can help it. What is the best course of action to take here?

    What I tried First

    First I tried following the installation documentation on the Qtile webstie:


    Installing on Ubuntu or Debian 11 (bullseye) or greater

    Ubuntu and Debian >=11 comes with the necessary packages for installing Qtile. Starting from a minimal Debian installation, the following packages are required:
    ​

    sudo apt install xserver-xorg xinit
    sudo apt install libpangocairo-1.0-0
    sudo apt install python3-pip python3-xcffib python3-cairocffi



    Either Qtile can then be downloaded from the package index or the Github repository can be used, see Installing From Source:
    ​

    pip install qtile

    But then I got the aforementioned error

    Continue reading...

Compartilhe esta Página