On Debian Bookworm and later, it is no longer possible to use pip to install Python packages globally. This relates to PEP 668 as explained by the Raspberry Pi docs.
Potential fix
It looks like the recommended path from Raspberry Pi is to use apt where possible to install Python packages at the OS level. The alternative is probably to use a virtual environment.
Notes
I am using Raspberry Pi OS (64-bit) from 2023-10-10 for the Pi, and my dev machine is a MacBook Pro running the playbook
PR with fix
https://github.com/geerlingguy/internet-pi/pull/565
Context
On Debian Bookworm and later, it is no longer possible to use
pip
to install Python packages globally. This relates to PEP 668 as explained by the Raspberry Pi docs.Potential fix
It looks like the recommended path from Raspberry Pi is to use
apt
where possible to install Python packages at the OS level. The alternative is probably to use a virtual environment.Notes