Personally I only ever use the system python packages on Linux if I can get away with it. Saves a whole world of problems.
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.