-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Can't install docker using pip on Debian 12 #57
Comments
That's the fix I used to use Pip in a Docker image, I think it might be easiest to just ensure that file is created on Debian 12 systems for now. It's annoying when python virtualenvs are trying to be shoved down everyone's throats, when system python has been just fine for decades :P |
Thanks for the linked solution, that's better than adding I mean yes they give a solution by telling us to install Should the role pip be adapted to remove this file automatically or maybe add a var to force the removal of the |
Just ran into this as well when checking out some bugs someone else on my team was having with my playbook. Ended up working around it with 2 quick and dirty tasks... tasks:
- name: get python3 version installed
ansible.builtin.command: python3 --version
register: py3ver
when: ansible_distribution == "Debian" and ansible_distribution_version == "12"
- name: remove EXTERNALLY-MANAGED if we're on debian12
ansible.builtin.file:
path: /usr/lib/python3.11/EXTERNALLY-MANAGED
state: absent
when: py3ver is defined and py3ver.stdout.find("3.11") != -1 edit: my use case is just installing a couple python packages on a vm/vps. I'm not using it in docker. Just to install the docker api so ansible's docker modules can work. |
Hello, just wanted to add my two cents, there appear to exist a special option: virtualenv that allows you to specify python virtual environment, i would prefer to see that utilized as opposed to removing
@phiilu |
the more I look into it, the more I think there is pretty much nothing we can do at this time, as current although… I managed to get something running, but it is infuriating to work with as i am not experienced with networking and sick and so every problem causes me stress. looking at it, this is even the wrong repo… |
So I noticed this got included in #58 and that it's broken now. |
sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED Then it works ;) |
It seem that this issue resurface on Ubuntu 24 as well |
Prepending this small role did the trick for me, regardless of Ubuntu/Debian shoving down venvs; ---
- name: Get Python 3.X version
ansible.builtin.command: python3 --version
register: pyver
changed_when: false
failed_when: pyver.rc != 0
- name: Remove Python 3.X EXTERNALLY-MANAGED file
ansible.builtin.file:
state: absent
path: "/usr/lib/python{{ pyver.stdout.split()[1] | regex_search('([0-9]+\\.[0-9]+)') }}/EXTERNALLY-MANAGED"
when: pyver.stdout | regex_search('3\.[0-9]+')
|
Using the following playbook worked just fine using Debian 11, but it seems to break on Debian 12:
Error:
Should I pass the option
--break-system-packages
as the error message suggests or should I use a virtualenv. I am not very familiar with the Python package manager or virtualenvs and I just need to be able to use Ansible to manage Docker.Thanks for your Videos and Open Source efforts 🫶🏼
The text was updated successfully, but these errors were encountered: