Languages tend to try to get around this by providing their own package registries and build systems to use them (npm, pip, cargo, etc), and developer tools often include some sort of sandboxing to avoid interference from the system packages (venv, bazel, cargo, nix develop, etc).
For user packages a tool like Snap, home-manger, Flatpak, or AppImage seems necessary.
Python makes the problems very obvious, especially since it has so many package management systems, gets used for system packages, and gets used for user applications.
Pipx uses the ecosystem standard of "make a venv" and it just exposes the binary entrypoint of what you installed.
It is exactly what everything says you should do, because everyone agrees. It just does it for you.