Comment by untrimmed

Comment by untrimmed 19 hours ago

87 replies

As someone who has spent days wrestling with Python dependency hell just to get a model running, a simple cargo run feels like a dream. But I'm wondering, what was the most painful part of NOT having a framework? I'm betting my coffee money it was debugging the backpropagation logic.

ricardobeat 18 hours ago

Have you tried uv [1]? It has removed 90% of the pain of running python projects for me.

[1] https://github.com/astral-sh/uv

  • mtlmtlmtlmtl 16 hours ago

    I'm sure it's true and all. But I've been hearing the same claim about all those tools uv is intended to replace, for years now. And every time I try to run any of those, as someone who's not really a python coder, but can shit out scripts in it if needed and sometimes tries to run python software from github, it's been a complete clusterfuck.

    So I guess what I'm wondering is, are you a python guy, or are you more like me? because for basically any of these tools, python people tell me "tool X solved all my problems" and people from my own cohort tell me "it doesn't really solve anything, it's still a mess".

    If you are one of us, then I'm really listening.

    • hobofan 15 hours ago

      I'm one of you.

      I'm about the highest tier of package manager nerd you'll find out there, but despite all that, I've been struggling to create/run/manage venvs out there for ages. Always afraid of installing a pip package or some piece of python-based software (that might muck up Python versions).

      I've been semi-friendly with Poetry already, but mostly because it was the best thing around at the time, and a step in the right direction.

      uv has truely been a game changer. Try it out!

    • tinco 15 hours ago

      As a Ruby guy: uv makes Python feel like it finally passed the year 2010.

    • Yoric 14 hours ago

      As a developer: it basically solved all of my problems that could be solved by a package manager.

      As an occasional trainer of scientists: it didn't seem to help my students.

      • buildbot 14 hours ago

        It installs stuff super fast!

        It sadly doesn’t solve stuff like transformer_engine being built with cxx11 ABI and pytorch isn’t by default, leading to missing symbols…

    • OrderlyTiamat 14 hours ago

      I'm (reluctantly) a python guy, and uv really is a much different experience for me than all the other tools. I've otherwise had much the same experience as you describe here. Maybe it's because `uv` is built in rust? ¯\_ (ツ)_/¯

      But I'd also hesitate to say it "solves all my problems". There's plenty of python problems outside of the core focus of `uv`. For example, I think building a python package for distribution is still awkward and docs are not straightforward (for example, pointing to non-python files which I want to include was fairly annoying to figure out).

    • beacon294 9 hours ago

      It doesn't handle python version management, it only handles pip. It doesn't solve bundling Python.

    • OoooooooO 13 hours ago

      As a mainly Python guy (Data Engineering so new project for every ETL pipeline = a lot of projects) uv solved every problem I had before with pip, conda, miniconda, pipx etc.

    • J_Shelby_J 15 hours ago

      Isn’t UV essentially cargo for python?

      • adastra22 14 hours ago

        Somewhat literally so. It is written in Rust and makes use of the cargo-util crate for some overlapping functionality.

    • rossant 10 hours ago

      I know, but uv truly is different.

    • jhardy54 15 hours ago

      I’m a “Python guy” in that I write Python professionally, but also am like you in that I’ve been extremely underwhelmed by Portry/Pipenv/etc.

      Python dependencies are still janky, but uv is a significant improvement over existing tools in both performance and ergonomics.

  • DiabloD3 17 hours ago

    uv is great, but I think the real fix is just abandoning Python.

    The culture that language maintains is rather hostile to maintainable development, easier to just switch to Rust and just write better code by default.

    • trklausss 17 hours ago

      Every tool for the right job. If you are doing tons of scripting (for e.g. tests on platforms different than Rust), Python can be a solid valid alternative.

      Also, tons of CAE platforms have Python bindings, so you are "forced" to work on Python. Sometimes the solution is not just "abandoning a language".

      If it fits your purpose, knock yourself out, for others that may be reading: uv is great for Python dependency management on development, I still have to test it for deployment :)

      • aeve890 17 hours ago

        >Every tool for the right job. If you are doing tons of scripting (for e.g. tests on platforms different than Rust), Python can be a solid valid alternative.

        I'd say Go is a better alternative if you want to replace python scripting. Less friction and much faster compilation times than Rust.

    • airza 17 hours ago

      There's not really another game in town if you want to do fast ML development :/

      • DiabloD3 17 hours ago

        Dunno, almost all of the people I know anywhere in the ML space are on the C and Rust end of the spectrum.

        Lack of types, lack of static analysis, lack of ... well, lack of everything Python doesn't provide and fights users on costs too much developer time. It is a net negative to continue pouring time and money into anything Python-based.

        The sole exclusion I've seen to my social circle is those working at companies that don't directly do ML, but provide drivers/hardware/supporting software to ML people in academia, and have to try to fix their cursed shit for them.

        Also, fwiw, there is no reason why Triton is Python. I dislike Triton for a lot of reasons, but its just a matmul kernel DSL, there is nothing inherent in it that has to be, or benefits from, being Python.... it takes DSL in, outputs shader text out, then has the vendor's API run it (ie, CUDA, ROCm, etc). It, too, would benefit from becoming Rust.

      • pjmlp 12 hours ago

        PyTorch also supports C++ and Java, Tensorflow also does C++ and Java, Apple AI is exposing ML libraries via Swift, Microsoft is exposing their AI stuff via .NET and Java as well, then there is Julia and Mojo is coming along.

        It is happening.

      • [removed] 15 hours ago
        [deleted]
    • pjmlp 16 hours ago

      I know Python since version 1.6.

      It is great for learning on how to program (BASIC replacement), OS scripting tasks as Perl replacement, and embedded scripting in GUI applications.

      Additionally understand PYTHONPATH, and don't mess with anything else.

      All the other stuff that is supposed to fix Python issues, I never bothered with them.

      Thankfully, other languages are starting to also have bindings to the same C and C++ compute libraries.

    • wavemode 12 hours ago

      Rust is not a viable replacement for Python except in a few domains.

    • Exuma 17 hours ago

      i hate python, but the idea of replacing python with rust is absurd

    • WhereIsTheTruth 15 hours ago

      abandoning Python for Rust in AI would cripple the field, not rescue it

      the disease is the cargo cult addiction (which Rust is full of) to micro libraries, not the language that carries 90% of all peer reviewed papers, datasets, and models published in the last decade

      every major breakthrough, from AlphaFold to Stable Diffusion, ships with a Python reference implementation because that is the language researchers can read, reproduce, and extend, remove Python and you erase the accumulated, executable knowledge of an entire discipline overnight, enforcing Rust would sabotage the field more than anything

      on the topic of uv, it will do more harm than good by enabling and empowering cargo cults on a systemic level

      the solution has always been education, teaching juniors to value simplicity, portability and maintainability

      • stonemetal12 12 hours ago

        Nah, it would be like going from chemistry to chemical engineering. Doing chemical reactions in the lab by hand is great for learning but you aren't going to run a fleet of cars on hand made gas. Getting ML out of the lab and into production needs that same mental conversion from CS to SE.

  • TheAceOfHearts 17 hours ago

    Switching to uv made my python experience drastically better.

    If something doesn't work or I'm still encountering any kind of error with uv, LLMs have gotten good enough that I can just copy / paste the error and I'm very likely to zero-in on a working solution after a few iterations.

    Sometimes it's a bit confusing figuring out how to run open source AI-related python projects, but the combination of uv and iterating on any errors with an LLM has so far been able to resolve all the issues I've experienced.

  • shepardrtc 14 hours ago

    uv has been amazing for me. It just works, and it works fast.

Galanwe 17 hours ago

> spent days wrestling with Python dependency hell

I mean I would understand that comment in 2010, but in 2025 it's grossly ridiculous.

  • virtualritz 12 hours ago

    So in 2025, in Python, if I depend on two packages. A and B, and they both depend on different, API-incompatible or behavior-incompatible (or both) versions of C, that won't be an issue?

    That's not my experience and e.g. uv hasn't helped me with that. I believe this is an issue with Python itself?

    If parent was saying something "grossly ridiculous" I must be doing something wrong too. And I'm happy to hear what as that would lower the pain of using Python.

    I.e. this was assumably true three years ago:

    https://stackoverflow.com/questions/70828570/what-if-two-pyt...

    • Galanwe 10 hours ago

      Well, first, this a purposefully contrived example, that pretty much does not happen in real life scenarios. So you're pretty much acknowledging that there is no real problem by having to resort to such length.

      Second, what exactly would you like to happen in that instance? You want to have, in a single project, the same library but at different and conflicting versions. The only way to solve that is to disambiguate, per call site, each use of said library. And guess what, that problem exist and was solved 30 years ago by simply providing different package names for different major version. You want to use both gtk 1 and gtk 2 ? Well you have the "gtk" and "gtk2" package, done, disambiguated. I don't think there is any package manager out there providing "gtk" and having version 1 and 2, it's just "gtk" and "gtk2".

      Now we could design a solution around that I guess, nothing is impossible in this brave new world of programing, but that seems like a wasted effort for not-a-problem.

      • adastra22 9 hours ago

        Maybe this doesn’t happen in Python, but I find that hard to believe. This is a common thing in Rust, where cargo does support compiling with multiple versions of the same crate. If I have dependency X that depends on version 1.x of crate Z, and dependency Y which depends on version 2.x, cargo will compile BOTH versions of crate Y, and handle the magic of linking dependencies X and Y to their own, different copies of this common dependency.

        • steveklabnik 9 hours ago

          Yes, Rust can do this. I know Ruby cannot, and I believe Python may not either, but I am less sure about it because I’m less good with Python’s semantics here, but I’d believe your parent.

  • adastra22 14 hours ago

    Yeah, because of a tool written in Rust, copying the Rust way of doing things for Python developers.

    • Galanwe 13 hours ago

      I am not even thinking of `uv`, but rather of pyproject.toml, and the various improvements as to how dependencies are declared and resolved. You don't get much simpler than a toml file listing your dependencies and constraints, along with a lock file.

      Also let's keep middle school taunts at home.

zoobab 17 hours ago

"a simple cargo run feels like a dream"

A cargo build that warms up your CPU during winter while recompiling the whole internet is better?

  • surajrmal 15 hours ago

    It has 3 direct dependencies and not too many more transitively. You're certainly not recompiling the internet. If you're going to run a local llm I doubt you're building on a toaster so build speed won't be a big ordeal either.

  • tracker1 13 hours ago

    I recently upped to a 9950X with a gen5 nvme.. TBH, even installing a few programs from cargo (which does compiles) is pretty quick now. Even coming from a 5950X with a gen4 drive.

taminka 18 hours ago

lowkey ppl who praise cargo seem to have no idea of the tradeoffs involved in dependency management

the difficulty of including a dependency should be proportional to the risk you're taking on, meaning it shouldn't be as difficult as it in, say, C where every other library is continually reinventing the same 5 utilities, but also not as easy as it is with npm or cargo, because you get insane dependency clutter, and all the related issues like security, build times, etc

how good a build system isn't equivalent of how easy it is include a dependency, while modern languages should have a consistent build system, but having a centralised package repository that anyone freely pull to/from, and having those dependencies freely take on any number of other dependencies is a bad way to handle dependencies

  • dev_l1x_be 18 hours ago

    > lowkey ppl who praise cargo seem to have no idea

    Way to go on insulting people on HN. Cargo is literally the reason why people coming to Rust from languages like C++ where the lack of standardized tooling is giant glaring bomb crater that poses burden on people every single time they need to do some basic things (like for example version upgrades).

    Example:

    https://github.com/facebook/folly/blob/main/build.sh

    • taminka 16 hours ago

      i'm saying that ease of dependency inclusion should not be a main criterion for evaluating how good a build system is, not that it isn't the main criterion for many people...

      like the entire point of my comment is that people have misguided criteria for evaluating build systems, and your comment seems to just affirm this?

      • Sl1mb0 16 hours ago

        > dependency inclusion _should not_ be a main criterion for evaluating how good a build system is

        That's just like, your opinion, man.

      • CodeMage 14 hours ago

        Dependency management should most definitely be one of the main criteria for evaluating how good a build system is. What's misguided is intentionally opting for worse dependency management in an attempt to solve a people problem, i.e. being careless about adding dependencies to your project in circumstances when you should be careful.

      • adwn 16 hours ago

        > like the entire point of my comment is that people have misguided criteria for evaluating build systems, and your comment seems to just affirm this?

        I think dev_l1x_be's comment is meant to imply that your believe about people having misguided criteria [for evaluation build systems] is itself misguided, and that your favored approach [that the difficulty of including a dependency should be proportional to the risk you're taking on] is also misguided.

        • taminka 16 hours ago

          my thesis is that negative externalities of build systems are important and i don't know how to convince of importance of externalities someone whose value system is built specifically on ignoring externalities and only factoring in immediate convenience...

  • quantumspandex 18 hours ago

    Security is another problem, and should be tackled systematically. Artificially making dependency inclusion hard is not it and is detrimental to the more casual use cases.

  • hobofan 15 hours ago

    > but having a centralised package repository that anyone freely pull to/from, and having those dependencies freely take on any number of other dependencies is a bad way to handle dependencies

    So put a slim layer of enforcement to enact those policies on top? Who's stopping you from doing that?

  • itsibitzi 18 hours ago

    What tool or ecosystem does this well, in your opinion?

    • taminka 16 hours ago

      any language that has a standardised build system (virtually every language nowadays?), but doesn't have a centralised package repository, such that including a dependency is seamless, but takes a bit of time and intent

      i like how zig does this, and the creator of odin has a whole talk where he basically uses the same arguments as my original comment to reason why odin doesn't have a package manager

      • zoobab 15 hours ago

        "a standardised build system (virtually every language nowadays?)"

        Python packages still manage poorly dependencies that are in another lang like C or C++.

  • IshKebab 17 hours ago

    This is the weirdest excuse for Python's terrible tooling that I've ever heard.

    "It's deliberately shit so that people won't use it unless they really have to."

    • taminka 16 hours ago

      i just realised that my comment sounds like it's praising python's package management since it's often so inconvenient to use, i want to mention that that wasn't my intended point, python's package management contains the worst aspects from both words: being centralised AND horrible to use lol

      my mistake :)

  • [removed] 18 hours ago
    [deleted]
  • MangoToupe 14 hours ago

    > the difficulty of including a dependency should be proportional to the risk you're taking on

    Why? Dependency hell is an unsolvable problem. Might as well make it easier to evaluate the tradeoff between dependencies and productivity. You can always arbitrarily ban dependencies.

  • jokethrowaway 18 hours ago

    Is your argument that python's package management & ecosystem is bad by design - to increase security?

    In my experience it's just bugs and poor decision making on the maintainers (eg. pytorch dropping support for intel mac, leftpad in node) or on the language and package manager developers side (py2->3, commonjs, esm, go not having a package manager, etc).

    Cargo has less friction than pypi and npm. npm has less friction than pypi.

    And yet, you just need to compromise one lone, unpaid maintainer to wreck the security of the ecosystem.

    • taminka 16 hours ago

      nah python's package management is just straight up terrible by every metric, i just used it as a tangent to talk about how imo ppl incorrectly evaluate build systems