You can still force it via `pip install --break-system-packages ...` if needed.
You can still force it via `pip install --break-system-packages ...` if needed.
Personally I only ever use the system python packages on Linux if I can get away with it. Saves a whole world of problems.
Not everyone might like containers, but using them for CI seems like a good way to avoid situations like this, at least when viable (e.g. web development). You get to choose what container images you need for your build, do whatever is necessary inside of them and they're essentially thrown away after once you're done with what you need to do, cache aside. They also don't have any significant impact or dependencies on the system configuration either, as long as you have some sort of a supported container runtime.
If you allowed sudo in your jenkins jobs you're morally barred from blaming python for screwing up the system.
On Linux, you either use the system packages via "apt install", or you use venvs.
EDIT: For context, I've meant "managed" distros like Debian and Ubuntu.
The situation with anything has been pretty bad in Debian lately.
I'm all for the minimalistic approach in regards to Python. It's Ok to provide only the packages needed by applications and the core system. For everything else, there's pip.
EDIT: I've meant to say, there's pip inside a venv.
For anyone on other systems who wants this kind of protection right now, pip has had this available for a few years at least:
pip config set global.require-virtualenv True
I absolutely recommend doing it. Immediately.I noticed with Homebrew that there was no way to untangle packages installed through pip and ones installed through Homebrew. After dealing with that mess once, I now make sure to use pip install --user. It can still cause things to break, but if that does happen it's at least easy to nuke the packages installed to my home directory.
And don't even get me started about how much better npm is at publishing packages, versus pip's refusal to add the same user friendliness.