While I don’t do frontend and don’t want to defend that mess, I think that locking a specific version for each dependency would solve this

Uv allows you to lock versions too. And creates a .venv inside the project which, I guess, is similar to the node_modules directory.

For sure, I was referring to the state of python before uv. Specifically projects not being self-contained, easily portable, etc

You could already do these things before, you just spent much more time twiddling your thumbs waiting for lock files to be resolved