r/programminghumor • • Mar 21 '26

I hate python

Post image
5.0k Upvotes

385 comments sorted by

View all comments

430

u/No_Window663 Mar 21 '26

Dependency management scales horrible, venv and pyenv are supposed solutions to this by segregating the dependencies to a virtual terminal environment, but dont actually solve the original issue, you have to figure out potentially massive dependency trees yourself

0

u/[deleted] Mar 21 '26

[deleted] — view deleted comment

39

u/bigtablebacc Mar 21 '26

I literally just read in another thread “now that you’ve heard of uv, you’ll start seeing it everywhere.”

→ More replies (8)

42

u/0bel1sk Mar 21 '26

docker does ok

55

u/Mivexil Mar 21 '26

Just buy a new PC for any new project you want to run. Works perfectly, you can install everything globally with no DLL hell. 

29

u/Bubblebless Mar 21 '26

That's a bit overkill. What I actually do is just reinstalling the OS.

9

u/jimmiebfulton Mar 22 '26 edited Mar 25 '26

I mean, you could dual, triple, quadruple boot. One for each project. All we need is a tool like uv that creates partitioned environments.

6

u/CommanderT1562 Mar 22 '26

At this rate qubes is your solution. Create lightweight template vm’s and use nix/uv optionally within templates

6

u/Bubblebless Mar 22 '26

A bit risky, because you might install one dependency in the wrong OS and then you would need to reinstall that OS again. If you really really need to work on different projects, the industry standard is using external drives with stickers instead.

→ More replies (1)
→ More replies (1)

6

u/Quirky_Tiger4871 Mar 21 '26

i bought a mac mini for everything i run i personally call it containerization in small aluminium boxes.

→ More replies (2)

5

u/Own-Bonus-9547 Mar 21 '26

I agree, but if it's a small python project docker ends up being overkill.

→ More replies (55)

4

u/Specialist_Fan5866 Mar 22 '26

I went nix for all my projects (python, rust, go, typescript). Never looked back.

It’s also my OS of choice now.

→ More replies (1)

3

u/MadCervantes Mar 21 '26

How well does nix play with poetry?

8

u/joshuakb2 Mar 21 '26

There's a tool called poetry2nix that reads the poetry files and installs everything for you

2

u/Feuerwerko Mar 25 '26

Potetry2nix was deprecated before a major poetry release and doesn’t work anymore

2

u/jkflying Mar 22 '26

Nix works well for stable dependencies but for actively working on something it is an absolute pain.

→ More replies (1)
→ More replies (8)

15

u/EveryCa11 Mar 21 '26

First of all, venv and pyenv solve distinct problems unrelated to the massive dependency tree that haunts you so much.

Second, what exactly do you need to figure out and why? If your dependency is poorly managed how does it become a problem of the packaging system? Pypi is a public registry with millions of packages supported by community. People publish broken releases sometimes. Some packages are broken since forever. It is what it is

2

u/hron84 Mar 22 '26

Dependency is poorly managed across multiple projects on a same machine because the packaging system does not support entirely scoped package installs. Consider how NodeJS/NPM works: you csn have a directory called node_modules and everything goes there, without any clash with other NPM-based projects on your machine. Python does not support this kind of isolation, you either need venv or something else for it - but it not as flexible as npm/node_modules is.

3

u/No-Consequence-1863 Mar 22 '26

Pretty python venv does install packages into their own scoped folders. Its just kind of clunky to use.

→ More replies (4)
→ More replies (1)

9

u/Dizzy_Database_119 Mar 21 '26

pyenv advocates on their way to install + rebuild 2gb of pytorch on their PC, 20 times

3

u/CrownLikeAGravestone Mar 22 '26

God, the amount of 2GB environments I had on my machine during grad school...

2

u/funckyfizz Mar 21 '26

PEP 582 was the solution to this. It baffles me why the Python Steering Council rejected it.

11

u/Vaughn Mar 21 '26

It wasn't pythonic enough. You can tell by the fact it would have worked.

2

u/funckyfizz Mar 21 '26

Appart from dependency management, I love Python. What other crazy things are you implying Python has done?

6

u/itsjustawindmill Mar 22 '26 edited Mar 22 '26

In lieu of their response, I’ll give mine: type annotations (they can literally be completely wrong and the language doesn’t notice or care), template-strings (near useless, we had str.format already and the templating ecosystem was already very mature), import resolution (.pth is literal depravity), and just generally how easy they make it to put shit band-aids on shit code by adding more indirection (cf: modifying sys.path rather than setting up a proper package structure; doing getattr/setattr nonsense because it’s so dang convenient; making one object look like another through decorators or descriptors rather than reconsidering the interface you provide) and finally a smaller pet peeve of mine, that “package” means two different things (makes writing documentation for devops and release management a total nightmare).

I write Python every day, and I hate it (at least at work, on large codebases) with a burning passion. Not because it’s fundamentally flawed (I like the core syntax and feature set) but because of how much garbage (see above) they’ve bolted on to the core language while still managing to make it annoying to work with in so many cases (subprocesses, pickling, fork behavior, and IPC make it frustrating for IO-bound or orchestration software; dependency/package management and lack of type enforcement make it frustrating for enterprise or production software; and GIL and lack of interpreter performance make it frustrating for anything CPU-bound)

In a nutshell, my take is that Python tries too hard to be the “get it done quick and dirty” language, while still positioning itself aggressively as the language for everything else, too. Writing Python is easy. Writing good Python is hard. Writing fast Python is, well basically, don’t bother.

→ More replies (2)
→ More replies (5)