this post was submitted on 28 Nov 2024
462 points (88.5% liked)

Programmer Humor

32743 readers
511 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] independantiste@sh.itjust.works 19 points 4 weeks ago (3 children)

Every time I use python it makes me want to throw my computer through my window. Doesn't happen with other languages. Pip fucking sucks it seems like every time I want to install dependencies for a project there is one that throws a compilation error when installing it. Like, why does it not try to download the version of the package that works with my version of python?? It doesn't even tell me why it failed!!!

[–] Swedneck@discuss.tchncs.de 8 points 4 weeks ago

i still do not fathom what on earth you people are doing to get these issues.
The worst annoyances i've had with python is just running the correct commands to install stuff, which is no different from working with git.

[–] riskable@programming.dev 4 points 4 weeks ago* (last edited 4 weeks ago)

Yeah that's annoying but it's a short-term problem. Python just recently cleaned up some long-standing issues that broke backwards compatibility in packaging (for certain things). Most public modules that broke made trivial changes to fix the problems (once they learned about them) and life went on.

However, for some fucking reason a whole bunch of dependencies related to AI are dragging their feet and taking forever to fix their shit. Insisting that everyone "just use Python 3.10" and it drives me nuts too.

This problem started to become a real thing almost two years ago (so they had plenty of warning and time to fix things) and yet here we are with still a handful of core dependencies that won't install for things like Stable Diffusion, Flux, and various LLM stuff because they're dragging their feet.

I blame corporate culture: Enterprises hate upgrading their shit and they're as slow as glaciers sometimes. There's probably tooling at Nvidia, for example, that needs a ton of work for Torch to work with new versions of Python and since all their documentation already was written for running on Python 3.10 (and Ubuntu 22.04 LTS) they've created a lot of work for themselves.

Any day now they'll finally finish fixing all these little dependencies and then we'll have another two years of ease before the problem rises again with Python 3.14 and it's massive GIL-free improvements that require big changes in code to actually take advantage of them.

[–] jas0n@lemmy.world 2 points 4 weeks ago (1 children)

Yup. The fact that the "proper" method to develop is to work in a sandboxed environment tells me everything I need to know. I feel like the only thing you learn from python is how to fight python instead of anything about programming. Personally, I think we need to stop recommending it as a first language.

[–] Incblob@lemmy.world 0 points 3 weeks ago (1 children)

So... The proper way is... Global installs? What are you saying here?

Just use poetry or something, install the environment in your project directory and you're done. The versions of your dependencies are fixed, so are consistent across installs, and because it's sandbox you aren't polluting your system, and vice versa.

And if you're using a language that installs the dependencies localy, guess what? That's what you're already doing, only with less security.

[–] jas0n@lemmy.world 2 points 3 weeks ago (1 children)

There's another one?! What's wrong with venv, pipenv, virtualenv, flit, conda, etc. I just want to write code, not fight with silly tools. It's a scripting language after all.

[–] Incblob@lemmy.world 0 points 3 weeks ago (1 children)

a) poetry came out 6 years ago, though UV is the new kid on the block, it's easier to complain about that if you want to.

b) so, you are fighting with silly tools, but don't want newer, hopefully better tools? If you aren't fighting with silly tools, then more options is bad? I guess it's a bit confusing for beginners?

c) how are you fighting with the tools? This is a genuine question, I don't remember the last time that the tooling caused a problem and I've been working professionally with python for the last 5 years, on both small and larger projects, first I used conda, and in the last few years poetry. In poetry, it's two commands to create a new environment, and install everything. The only time I had a problem was with an internal library that had misconfigured dependencies.

d) here's the rundown on the dependency tools:

  • Virtualenv is one of the oldest, from the python 2 times
  • venv is just a subset of Virtualenv that was integrated into the standard library to have venvs available without external tools
  • conda is not python specific, it also does R, Ruby, some DB stuff, etc... It tries for maximum compatibility with various systems. This is apparently very useful in bioinformatics which use very disparate tools.
  • Pipenv is an attempt to implement ruby-like dependencies. I don't know much about it, it's not used much.
  • flit is lightweight, for publishing packages only -poetry is what I am currently using. Simple toml based dependencies. Installs the packages wherever your want. Since it uses toml, it's compatible with other tools like dependi to check for updates. It's got a pretty good set of commands that you don't need to remember because init and update is what you need 90% of the time. Can also publish packages, and has separate dev/prod dependency groups.
  • uv is the new one, written in rust (of course) and very fast. Also installs python versions, meaning you no longer need a separate tool/docker images to manage your python versions. No multiple dependency groups yet. Aiming to become the only tool you need to do anything in python. Still <v1.0 and not feature complete.
  • pdm is more of a project manager, that allows for plug ins, scripts, and also no virtual envs if you want. Does a lot of things similar to poetry.

I mean, every one if these has a reason for existing, and is an improvement of the previous one (pdm started as a personal project, let people have their fun) . It's also a good few years between them, so it's not like they're spamming them.

[–] jas0n@lemmy.world 2 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

My bad. I personally can't stand Python, and am just a python hater. If I used python professionally as a general purpose language, I would probably want all the tools. Though.. I never needed a virtual environment in another language.

In the codebases I work in, python is occasionally used as a cross-platform scripting language, which is where its bread and butter should be. Never more than 200 lines. Every time I crack open a codebase, if there is any python, it doesn't work. That will be the thing I have to fight before I get to work on the real problem. If it has been a year, it's broken. If it's a Linux project, you're better off using Bash if you want it to run a year from now. On Windows, well..

[–] Incblob@lemmy.world 2 points 3 weeks ago (1 children)

Did... Did someone on the Internet admit to not being 100% correct?!

What is happening right now? Is it the apocalypse? the end times?

Has great Cthulhu risen, neath the dark waves of the abyss to tear mind from-

Ok, a bit dramatic, but when was the last time you saw anyone give an inch in an online argument?

Anywho, thanks for the context, though I think the idea of python as a "scripting language" is a bit overblown.

[–] jas0n@lemmy.world 1 points 3 weeks ago (1 children)

I felt bad you typed all that out when I'm just a python hater who isn't able to argue in good faith.

[–] Incblob@lemmy.world 3 points 3 weeks ago

It's fine. I rarely comment anywhere, and it didn't really bother me that much. I'm at home with corona (already feeling better), so I had the time to give a thorough answer.