Post History
The system Python is for use by your system and it's better to not use it directly. It won't be good for you or the system. Most distros will install Python in a system-wide location so that packa...
#1: Initial revision
The system Python is for use by your system and it's better to not use it directly. It won't be good for you or the system. Most distros will install Python in a system-wide location so that packages that need Python can work. You're not supposed to `pip install` stuff on this Python. Instead, if an additional Python package is needed, your package manager is expected to create the same files that `pip install` would, via packages named like `python-requests`. If you run `pip install` on the system Python: * When a new minor version of Python comes out all those packages will "disappear". Say you have Python 3.12, `pip install` on system Python will put the files in `/lib/python3.12/site-packages/`. When Python 3.13 comes out and your package manager updates it, it will set up `/lib/python3.13/site-packages/` and move all the `python-` package files there. But it won't move your `pip install` packages, because it doesn't know about them. You'll have to do it manually. Python releases minor versions frequently enough that this will create busywork over time. * Your packages will conflict with the package manager. Say you `pip install requests` and the files go in `/lib/python3.12/site-packages/`. Later, your package manager tries to install `python-requests` which goes in the same place. You will get errors about "file already exists". * There's probably safeguards like forcing you to pass `--break-system-packages` to do it, so it will be tedious. Luckily you don't have to deal with this stuff at all. Set up a tool like https://github.com/pyenv/pyenv and you will still have commands like `python` (which now, for you, point to an isolated Python and not the system one). Your Python packages won't be affected by system upgrades. You can easily run multiple versions side by side and switch them. You can also manually create a Python venv somewhere like your home directory. This doesn't have all the conveniences of a tool like pyenv though, so usually isn't worth the effort.
