Ubuntu/Debian team will permanently forbid to use pip/3 in global environment since ubuntu23.*, I encounter the same problem in Ubuntu24, and your solution could work currently, but I fear it'll not work in the future. So just follow their standard: don't use PIP to install global python packages. Python's running environment is really in messy status.