In this link, one can read:
Pip installs dependencies using a recursive serial loop. Pip does not check to see if all of the dependencies of all packages are met at the same time.
If the packages installed earlier in the order have incompatible dependencies with versions that are different from the ones installed later in the order, the environment is broken, and most importantly, this problem goes undiscovered until you notice some unusual errors.
I was wondering whether this is true, and if not, how pip does exactly its package management?
In the pip documentation, the closest topic to this I could find was dependency resolution
, with the following description:
At the start of a pip install run, pip does not have all the dependency information of the requested packages. It needs to work out the dependencies of the requested packages, the dependencies of those dependencies, and so on. Over the course of the dependency resolution process, pip will need to download distribution files of the packages which are used to get the dependencies of a package.
This quote does seem to point in the direction of the initial quote (it only checks the dependency structure starting from the package we want to install, it does not check the whole environment), but I'm not sure.