Disposable Python environments for ad-hoc analyses
ericmjl.github.io
ericmjl.github.io
The response to the resulting chaos has been to normalize setting up a complete custom "environment" for every. Single. Script. And they keep doubling down with more elaborate ways to do that.
Not expecting, or even respecting, discipline is probably one of the reasons the language has gotten so popular.
I don't know what you're supposed to do if you have a security issue. Not using Python for anything important comes to mind.