Hacker News new | ask | show | jobs
by dmart 555 days ago
Venvs are so clunky and probably the biggest stumbling block for beginners. There was a proposal for a directory-based node_modules analogue which was unfortunately rejected.

I think that would have been the single biggest improvement to the Python onboarding experience ever.

2 comments

> There was a proposal for a directory-based node_modules analogue which was unfortunately rejected.

There were many problems with the proposal. The corresponding discussion (https://discuss.python.org/t/_/963) is worth looking through, despite the length.

Installers like Pip could help by offering to install `--in-new-environment` for the first install, and Brett Cannon (a core developer) has done some work on a universal (i.e. not just Windows) "launcher" (https://github.com/brettcannon/python-launcher) which can automatically detect and use the project's venv if you create it in the right place (i.e., what you'd have to do with __pypackages__ anyway).

Indeed, python dug its own grave by not supporting in-directory venv.

One can emulate it with tools like poetry and uv but that incurs a performance penalty that every script has to go through `poetry run` and `uv run` which is often a few hundret ms and unsuitable for performant CLIs.