If your distribution allows using pip (most don’t)
Either create a venv for the python package in question ($ python -m venv venv in the package build directory) and activate it ($ . venv/bin/activate in the package build directory) before running the program or running pip commands, or use pipx instead of pip).
Either create a venv for the python package in question (
$ python -m venv venvin the package build directory) and activate it ($ . venv/bin/activatein the package build directory) before running the program or runningpipcommands, or usepipxinstead ofpip).Or
--break-system-packages, then never run as root and runrm ~/.local/lib/python*to clear.