geerlingguy / internet-pi

Raspberry Pi config for all things Internet.
MIT License
4.29k stars 448 forks source link

Issues installing python3-docker within the tasks/docker.yml playbook (and a dirty solution) #523

Closed james-willdooit closed 1 year ago

james-willdooit commented 1 year ago

As of Debian Bookworm and Ubuntu 23.04, in order to install pip deps, you will need to implicitly pass the "--break-system-packages" argument to pip3. This currently isn't an issue for raspbian (for now :)), but if you are running this on the likes of Debian Testing, this will cause some issues.

Until Jeff (or someone kindly created a PR to manage the pip deps in a Python Managed Environment), you will need to edit tasks/docker.yml to include:

extra_args: -break-system-packages

under the Install Docker Compose task.

Further reading: https://discuss.python.org/t/pep-668-marking-python-base-environments-as-externally-managed/10302/69

geerlingguy commented 1 year ago

See related: https://github.com/geerlingguy/ansible-role-pip/issues/57

james-willdooit commented 1 year ago

Ahhh, sorry, missed that. I am on the fence about this being enforced.

https://github.com/geerlingguy/docker-debian12-ansible/blob/master/Dockerfile#L19-L20 Is a great solution and I am stealing it :) and I agree, I see no advantage enforcing python envs in containers.