Skip to content

pip cannot install anything without venv or --break-system-packages on absolutely most of recent Linux distributions #20

@mrwesadex-flant

Description

@mrwesadex-flant

Is there an existing issue for this?

  • I have searched the existing issues

Is this a security issue?

  • This is not a security issue

Describe the bug

MacBook-Pro playbooks % ansible-playbook -i hosts.ini ais-deployment/install_requirements.yml -K
BECOME password:

PLAY [Install requirements on localhost] ****************************************************************************************************************************************************************

TASK [install_ansible_collections : Install ansible collections listed in the collections file] *********************************************************************************************************
ok: [localhost]

PLAY [Install requirements for controller hosts] ********************************************************************************************************************************************************

TASK [install_controller_requirements : Ensure Python 3 and pip are installed] **************************************************************************************************************************
[WARNING]: Platform linux on host controller_host is using the discovered Python interpreter at /usr/bin/python3.12, but future installation of another Python interpreter could change the meaning of
that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
ok: [controller_host]

TASK [install_controller_requirements : Upgrade pip to the latest version] ******************************************************************************************************************************
fatal: [controller_host]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "-U", "pip"], "msg": "\n:stderr: error: externally-managed-environment\n\n× This environment is externally managed\n╰─> To install Python packages system-wide, try apt install\n python3-xyz, where xyz is the package you are trying to\n install.\n \n If you wish to install a non-Debian-packaged Python package,\n create a virtual environment using python3 -m venv path/to/venv.\n Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n sure you have python3-full installed.\n \n If you wish to install a non-Debian packaged Python application,\n it may be easiest to use pipx install xyz, which will manage a\n virtual environment for you. Make sure you have pipx installed.\n \n See /usr/share/doc/python3.12/README.venv for more information.\n\nnote: 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.\nhint: See PEP 668 for the detailed specification.\n"}

PLAY RECAP **********************************************************************************************************************************************************************************************
controller_host : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Expected Behavior

Playbook must create venv and use that for package installation. All of your playbooks which install anything

Current Behavior

Playbook doesn't create venv and therefore it cannot work as it listed in documentation

Steps To Reproduce

ansible-playbook -i hosts.ini ais-deployment/install_requirements.yml - run this on clearly installed Debian 10+, Ubuntu 18+, CentOS 8+ etc.

Possible Solution

No response

Additional Information/Context

No response

AIS Operator version

No response

AIStore version

No response

Environment details (K8s deployment type and version, etc.)

k8s 1.31, Debian 12, Ubuntu 22.04, CentOS 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions