pip shenanigans


Today I learned the hard way about pip's --upgrade default behavior.

I wanted to upgrade a package and ended upgrading all it's dependencies, thus breaking my web app and wasting time hunting down the cause of the problem.

I've made a huge mistake

As clearly stated in the docs, the default behavior is to do a recursive installation, meaning upgrading every dependency to its latest available version even if already satisfied.

So I guess the title isn't really fair since this was clearly a product of me not RTFMing. I hope this works both as a reminder and a warning to be more careful in the future.

On the bright side, I understood why it's better to use --no-deps to not only prevent this but to ensure the exact stated packages will be installed when working with a requirements.txt file.