Hacker News new | ask | show | jobs
by brundolf 1827 days ago
The packaging/environments story is really just unacceptable to me in the year 2021. Coming from the JS world, Python's is just a total mess. And it can't even really lean on the "Python didn't start out as a language that needed that stuff" angle, because JS was in the same boat, and overcame it.

Maybe it's too late and it would be an XKCD "now there are 15 competing standards" situation at this point. But Python desperately needs an all-in-one, officially-sanctioned, package manager/manifest format/bundler/etc that keeps all dependencies and environment info in the project directory, not in global symlinks that get shuffled around by a global collection of "virtual environments". It needs to get installed automatically alongside Python itself. It needs to be prescribed by the Python Foundation. And it needs to be here yesterday.

2 comments

As an occasional Python developer this is the thing I dislike most about it. I always end up spending an hour or two figuring out how to get things installed and working right.

To be fair Node also requires some work to be setup correctly but it seems easier.

I thought it should be better now? Last I checked people used poetry for this
I first heard of Poetry (posted to HN) several minutes after making this comment.

I’ll definitely give it a shot next time I do any Python dev.

Maybe Guix can save the packaging aspect, which would need to include C and C++ extensions.
We've got pip, conda, poetry, etc, all with their different advantages and disadvantages. I think the only thing that could solve the fragmentation problem is an authoritative solution from the Python Foundation itself. Cohesion is what's needed, not more options.
The thing is that a comprehensive Python packaging solution would need to include packaging of C and C++ extensions at least. And that's not simple. In the meantime, Guix is establishing itself as a cross-language package manager wich can define an own distro, or run on top of a POSIX system like Debian, Ubuntu or Arch. And it is rock solid and currently features around 17,000 packages. A new Python packaging solution would have a hard time competing with that.
I believe pip and conda already support native modules. I'm not saying it was easy to get there, but it's a solved problem at this point. The problem that still needs to be solved is project-scoped dependencies vs system-scoped dependencies. Virtual envs are a hacky workaround that causes all sorts of problems. I'm convinced Python has been one of the major drivers of Docker's adoption, because any given module is concerned with the entire system.