The answer here is isolating each of the applications from each other. Don’t make all of them use the same set of Python packages. Use a separate venv/virtualenv for each of them, or utilise a higher level of isolation for each application (Overview of Python Packaging - Python Packaging User Guide talks about this, in terms of “depending on …”).
+1 to what @FFY00 said. That said, I can understand how sometimes the needs of the upstream package can be different from your project.
In those cases still, you can depend on weird_dep@main… the following work:
Mixing multiple versions of a single package, in a single Python process, is usually a really bad idea. See the following post, from one of the threads you’ve mentioned: