When you use a Python virtual environment, you can activate it for different projects. Whatever packages are in it will be used by the project code. When you use npm, there will be a node_modules folder where the packages are kept, and this is per project.
In my mind, there's a really logical and straightforward way of handling packages: having a single library for all your projects, a list of requirements per project, and then the project uses the packages from that single library. I believe pnpm has this approach to some extent.
What I do not understand is: why is this approach not the norm? For instance, in Python, I don't even know of anything of the sort. Are there some obvious challenges with this or some obvious benefits to the other methods that I am missing?