I know it's difficult since we have jobs, but Java bros, it's time to fight back
And then you go to C/C++ and notice that there simply isn't one standard dependency management tool.
Oh there is. It's called CMake.
I know it sucks but fuck everything else. Just use CMake. Just do it and stop complaining. Any C/C++ project without a CMakeLists.txt is considered a bug and should have an issue filed over and over again until it's implemented.
A) cmake isn't THE standard it's A standard.
B) cmake isn't a package management solution it's build system with some tools for package management
Many projects are moving away from cmake for several reasons. poor package management and poor build isolation being some of them.
The closest thing to a standard system for finding and using c/c++ dependencies is pkgconfig. However it usually isn't present on windows and is not responsible for installing the dependencies only for announcing them.
If there was a standard C/C++ package management solution msys2 wouldn't exist.
this last sentence is just wrong. msys2 has nothing to do with package management at all. it's an attempt to serve equivalent libraries (.dll) that may only exist on linux systems (.so) within the windows eco system. this is written on the website itself:
MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software.
Yes that is the goal, however msys2 would be a rarely used tool if there was a single proper package manager for C/C++ libraries on windows.
it's an attempt to serve equivalent libraries (.dll) that may only exist on linux systems (.so)
That's not even what their own description even says. All of those libraries exist as pure windows builds, msys provides a streamlined way to fetch them and locate them on your system, like a package manager...
Me, using msys2 to organize Python venvs:
Many projects are moving away from cmake for several reasons. poor package management and poor build isolation being some of them.
Do you have a list of projects that have 1) used CMake in the past, and 2) have then migrated away to something else, and 3) their stated reasons for doing so.
I'm not calling you a liar, but I can't help but call out your journalistic use of the weasel word "many" and "several reasons" here.
Well I personally migrated from Cmake to meson and I found a few other posts of people doing the same. For now most projects that adopted cmake tend to stick with it, unless the encounter serious problems (which I did, causing me to migrate).
The core reasons are the following:
These are the core reasons you hear from projects adopting meson or build 2. Yes by far most of them come from pure makefiles or autotools, but there are some that come from cmake.
Also in my experience meson tends to have faster setup and compile times. Due to the more sane syntax it also allows you to get started with a project more quickly.
X11 switched to meson. Actually a lot of projects have switched from cmake to meson.
X11 never used CMake. They switched from autotools to Meson. I'm asking about projects that have used CMake and then migrated away from it.
Actually a lot of projects have switched from cmake to meson.
Could you list a few?
It exists. Its not "standard", but then there will likely never be a standard C package manager because its out of the scope of the project and been that way for 40 years.
Well there is also vcpkg. Both do basically the same thing with minimal advantages over each other.
There is a chance C++ might get a package manager but C will never get an official one.
I watch The cherno videos. He does C++ code reviews and in almost every code reviews, half of his video is fixing broken packages and CMake scripts. While I don't understand the errors on a deep level, it's what keeping me away from making C++ my primary language
Personally I did C++ for awhile before I went into C, C has alot more control and is just better, and if you need OOP, just use C#, or golang
I guess rust is technically better than C++ but the community and the fundamental un-readable nature of the code - literally gave me a migraine that lasted for afew days - pushed me away after 2 months
Rust isn't unreadable lol, just a little different.
Also, cargo (an actual standard for package management) is great.
Yeah, cargo alone is already a good reason to migrate to migrate to rust. CMake is just such a clusterfuck. It doesn’t even help when you understand how it works, because half of the people messing around with C/C++ don’t or only have a vague idea about it. So you‘ll end up fixing the CMakeList.txt they messed up.
Arguably only strong argument in favour of C++ is templates - but it's also reason enough to use the language. I'm yet to find something comparable; various codegen/macro solutions feel much harder to write and use as you go.
And sure, it can be hard to learn and debug (those famous few-screens-long compiler errors), but when used right it's very pleasant to use, especially for unit testing - can easily do proper mocking/dependency injection while keeping dependencies resolved compile-time.
I guess rust is technically better than C++ but the community and the fundamental un-readable nature of the code - literally gave me a migraine that lasted for afew days - pushed me away after 2 months
I mean the community sucks, and dependency culture sucks, but you can mostly avoid that by just not interacting with the ecosystem. And cargo makes bunch of stuff pain in the ass that’s easy in most C++ build systems, but once you figure it out, it’s not that awful.
But the language doesn’t really have a readability issue, it’s pretty easy to read… The syntax is just inelegant and approaching C++ levels of ugly… But C++ has the same problem, and lot of other languages like C# are even worse so I don’t think ugliness is ultimately what stops people from using something.
What exactly sucks about the Rust community? I know that certain places like reddit and YouTube definitely have a level of circlejerking and evangelism, but when I'm looking through issues and pull requests on GitHub I just see people working.
What exactly sucks about the Rust community? I know that certain places like reddit and YouTube definitely have a level of circlejerking and evangelism, but when I'm looking through issues and pull requests on GitHub I just see people working.
Evangelism is what I dislike in general. The dependency culture is bad (I want to punch through a wall everytime I see a “anyhow” dependency), there is also a lot of “invented in rust” even though it wasn’t eg. every time I see a rustacean claim that rust invented coproduct types I die inside a little.
And they wholesale adopt some of the dumbest memes from C++ community and repeat them ad naseum. Like I thought “Zero cost abstractions” has finally died and I would never have to hear that shit ever again, rust community successfully revived it and kept it alive for the last several years. They also invent new even more ridiculous ones “If it compiles, it works” is the one I keep hearing a lot and that one just drives me insane.
Look at this nonsense ->
pub async fn run_search<T>(
args: CliArgs,
cfg: AppConfig,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
T: for<'de> serde::Deserialize<'de>
+ HasTitle
+ HasYear
+ HasDetails
+ HasId
+ Eq
+ PartialEq
+ Promptable
+ Clone
+ Send
+ Sync
+ 'static,
T::Details: HasRuntime,
{
I mean that’s not particularly bad, the worst thing here is the “de” for the serde lifetime, which for the record I think is a dumb name. Most of this is pretty obvious what it means… It’s ugly but readable
I had a similar experience but came to different conclusions. I started with C++ (technically GML but I wanted to learn a real™ language) and kept bashing my head with it on and off for a while until I completely burnt out with it and just went with C.
I stuck with C and got really good with it for about 10 years or so (and use C exclusively at my current job still) before I picked up Rust a few years ago.
Rust isn't an easy language but it feels less...bolted on than C++? It's hard to describe, but in a weird way I feel like learning Rust (and even Java to some extent) made learning the language features and concepts in C++ more approachable. I'll be thinking somewhat often "oh this C++ thing is like this thing in OtherLanguage™ just with clunkier syntax and more footguns. That's all."
It's the reason I prefer Rust over C++. Cargo is so good.
I hate Rust grammar, I deeply hate it
It took few weeks to get used to it. If expressions are very neat tho.
If you mean the rust syntax, same. Although im still trying to code more and get used to it, it's a great language
Yes, sorry
To be frank, if you're able to, I would generally avoid C++ in this day and age anyway.
I have never ever installed something with Cmake and not had 1 million errors and had to fix them, c and c++ package management is the most garbage of any language
I honestly think the lack of a de jure build and package system will be the downfall of C/C++ more than any of the footguns or warts in the language syntaxes themselves.
I quite like Conan
If it wasn't moving so slowly, was less opinionated and had anything actually resembling a healthy package index (conan-center-index is a joke tbh), yeah, maybe. At least they don't use JSON for their configuration files.
Never going back after trying Meson
Cmake isn't similar to a package manager.
Just do it and stop complaining
And this is why C has such a fucking bad name, because of people like you
Yeah the world needs more complaining
Makefile is better
Java has a standard dependency management tool? Maven and Gradle would disagree
Ant has ivy
Ages ago Apple tried something with those .framework
folders. Did you hear about it?
Divided by languages, united by "Chat, please fix"
Until it deletes the db because vibe coding bad
Sure!, here's the revised code without the changes you told me to exclude!
Includes the changes I told it to exclude
When you said "Chat, please fix" it made me think of a programmer streaming on twitch, asking viewers for help.
You don’t blame the screwdriver for being a bad hammer if you fail to understand how to use the tool correctly.
✍️✍️✍️🔥🔥🔥
If a screwdriver required as much shenanigans to screw something as Python does to use it, I would happily screw things with a hammer instead.
Java is so boilerplate and outdated
First appearence dates:
🤔
Python started with Python 3 in 2008, the other versions are... something else
Python 2 was fine for its time and purpose, but I wasn't a fan of it. Python 3 though, especially more recent versions, that's the good stuff.
I can also make java newer by arbitrarily choosing a later version of the language as the starting point.
I suppose their point is that python did a pretty deep and breaking change at python 3, effectively re-inventing itself to shed its bloat.
Choose any starting point, you can't make Java seem modern
Spoken like someone who's only knowledge on java is seeing some code example based on java8 and formed his entire opinion on the language on it.
Fair enough, but I've never seen someone using anything other than python 3, Java 8 on the other hand..
You've never seen anyone use python 2.7? People were just starting to switch in 2018.
can confirm, still using 2.7
Just shows how good it is 😎
I think the controversy should end at this point
Does that even happen nowadays? Seems like a 2010's thing
Happened to me last week. Depends what stuff you try to use.
Not that java is actually any better. "Write once, debug everywhere", as we used to say.
Ironically JavaScript is becoming the "write once run everywhere"
Until the build breaks for no reason.
It works on my local host tho
works_on_my_machine.png
[deleted]
People love to hate on Maven/gradle because it's slightly more difficult, only to realise it works way better than pip and npm. If "difficult to use = bad" then rust would've been hated, contrary to its current state
the biggest issue I have is when a package is in pip, figuring out what it's called in conda (if it exists).
What do you use conda for nowadays?
data science. I'm using prebuilt base containers and that's what it uses.
strongly recommend shifting off of conda or just using it to install a better dependency manager. Was nothing but trouble for our DS team until the SWE team showed them the light of UV
uv my beloved.
Heard, friend. That's the beauty of containers is the moment it doesn't work I can throw it away! Using NVidia's containers. adding whatever we need in top has been easy enough.
I am curious what specific horror stories people have. I'm seeing the horor but deeply curious about the details
I use conda at work because IT's security settings break venv and uv...
It does because pip is still a terrible package manager. And the fact that it installs globally if you forget to activate virtual env is still a problem. Nothing 2010 about it
Not if you’re using UV or Poetry. PiP is useless but there are legitimately good tools which make this a non issue.
Happened to me last week at work when I tried using tflite and some libraries and got mismatching numpy versions, spent a big while trying to fix it before giving up and taking an alternate route
just use uv, its a godsend
We had to run it on a debian-dockerised container inside of a Toradex controller. We had limited options
I spent literally entire weeks just last year on untangling a dependency nightmare caused by some random ass cryptography library, some openssl libraries, and some conflicts way upstream of those
Python is actually incredible if you are dealing with maintained packages from good contributers and companies.
Java on the other hand, I have used some really old and outdated swing libraries that were last updated a decade ago and they still worked with my app. I was amazed
Not a Java dev, so could be wrong, but isn't Java known for its 12 page long error traces? Sounds a bit like the pot calling the kettle black.
Yep. But the error is stated right at the top, with the exact exception (if it is) which makes it easier to catch it in a try and catch statement
The "long errors" don't make sense because no one is gonna tell you to scroll down and read it all. The exception, why it occured, and the line number are all at the top in most cases.
The long errors do get annoying when you get multiple exceptions at the same time, which means that you're doing something very wrong to get multiple exceptions at the same time
And with Python you get the same thing (exact exception, etc.) at the bottom of the trace, you know, the part you see on your terminal screen while the top of the stack trace is somewhere up there you need to scroll to.
This. Plus, you get an exact highlight of the source line that causes the exception. Honestly, this sounds more and more like a python W.
I have never had any issues with just pip and no one i know has had any issues with pip.
That's good to hear, pip does work in some general scenarios but the moment you use some non-mainstream library you really need, it starts to break down. At least for me, and my colleagues at work
Use uv
I was away from Python for about 10 years and it was quite disappointing to see how things did not evolve.
NPM and Node module resolution is ages ahead of Python.
- “Oh, but node_modules is huge”
- “bla bla bla left-pad”
These are just testaments of how great is Node’s module management.
have you ever tried uv?
Yes, but there are multiple competing standards, multiple ways to do the same thing.
Even the most recent attempt of standardizing the lock file went down when uv said they won’t be using it (this info might be outdated).
I mean sure npm is probably only the second worst package management solution after pip… I would probably take CMake over either of these and CMakes package management is always a guaranteed source of severe mental distress. That’s how bad they are compared to every other ecosystem…
How do you organize a super fragmented ecosystem?
Make dependency management and build system almost like another programming language.
I have been developing using python for over a decade and never had any of these issues. What are you guys developing?
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Yeah it’s a real struggle
Check out uv.
uv init
uv add package
uv run main.py
Either way, idk how ppl are having package management issues with Python these days.
I'm almost positive it's people who don't use venv and then get mad that they can't get the older versions of packages in their live system due to version requirements of other packages.
Venv is a lifesaver. And I think JS folks are just too used to npm defaulting to the current directory without the -g global. Whereas pip defaults to global.
I use both js and python in my work a lot. And I've watched the people on both sides complain about the package management of the other side. Lol. But the truth is, they both have issues that the power users just forget are issues because they're used to working around them.
Not compatible with your python version, sorry.
UV venv --python {version}, or alternatively if the repo has .python-version, it's set automatically
Better yet, use a pyproject.toml file.
uv init
will automatically set up a project.toml file with a build backend and version requirements
I meant the .python-version file, you should define the Python versions in the toml as well.
uv init
does that automatically too.
I know, I use uv myself.
Oh, running this on Windows? Screw you here's an obscure error instead of a clear message telling you the library only supports Linux/Unix systems.
(This was every major AI Python library until 2023)
"running on Windows"
closed as user error
Baka user.
You forgot an argument? Here's the exact implementation of it in it's underlying C implementation! (But hey it does tell you the exact error at the end of the error log, thanks)
Ah, should've used python3.9 instead of python3.12
Nah. This just didnt work for me at all. I literally had to go to pypi and download each whl and manually install each dependency after wrestling with the company proxy because for some reason, pip could not find any modules that are compatible with the environment. I m guessing some funky settings on uat/prod servers by the network team.
Package libobscurev3.2.1 is not available on your OS
Strawman. None of this is real in Python if you just use a venv...
I don't mind Java, BTW.
Sometimes you dont have the luxury of using a virtual environment. Sometimes you are stuck on whatever version of python is available and whatever environment the system has access to (eg Kodi Vs xmltree = 😞)
Do you like janky syntax, supply chain attacks, and abstractions that depend on C?
That is to say, are you a python user?
Consider the crab language.
I am still trying to get used to its syntax. Although I wanna use the crab language the syntax just makes me want to quit it
It takes a lot of getting used to. I've messed with crab before but when picking it back up I struggled with the syntax nonetheless.
Like, when to let mut and when not to let mut. Sometimes, when you make a variable with a long lifetime but assign it in a smaller scope, you might get a warning or error for initializing it as mutable because you only use it after assigning it later. And if the program believes it's only ever going to be mutated once, it might just expect you to let it uninitialized and make it immutable. This can also create a warning or even an error, depending on the situation.
So then you make it immutable, only assigning it once and never mutating it afterward... Until you add more code and suddenly you're mutating it. Then you have to go back and make it mutable.
And that's the *tip* of the iceberg.
Still, after using it a while, I really think it could make a good python replacement, especially if the python version of your program was gonna ship as bytecode or a binary with the python code and interpreter jammed in anyway.
Like, when to let mut and when not to let mut. Sometimes, when you make a variable with a long lifetime but assign it in a smaller scope, you might get a warning or error for initializing it as mutable because you only use it after assigning it later. And if the program believes it's only ever going to be mutated once, it might just expect you to let it uninitialized and make it immutable. This can also create a warning or even an error, depending on the situation. So then you make it immutable, only assigning it once and never mutating it afterward... Until you add more code and suddenly you're mutating it. Then you have to go back and make it mutable. And that's the tip of the iceberg.
None of this is syntax related tho? Rust is ugly… But this is all about semantics and actually the correct way to handle them anyway, there is nothing to struggle with… Like the complicated parts of rust all live in proc macros and combination of async and lifetimes.
Still, after using it a while, I really think it could make a good python replacement, especially if the python version of your program was gonna ship as bytecode or a binary with the python code and interpreter jammed in anyway.
I mean rust and python are basically diametrically opposed. The only sane reasons to ever use python is that it has great standard library and really fast iteration speed. You use rust for everything else the language has to offer in spite of having a standard library that kinda sucks and iteration in it being painfully slow even in comparison to something like C++.
None of this is syntax related tho?
In full disclosure, it was all I could think about lately because it's been driving me crazy. I could go down a long list of syntax weirdness but a lot of it boils down to "why do I need to write a novel to make this work"
iteration speed
Well now I know one thing I don't need to test in my program. Kinda sucks given matching and iteration are actually pretty fun in crab. It makes parsing things pretty easy, but it makes a lot of things that would be easy in C++ super frustrating unless I just... Ya know... Enter unsafe and drop to C.
Rust is sadly never replacing python because the extremely vast difference in syntax and their use cases. It can compete, but never replacing it unless rust announces some ground breaking changes that completely changes the way we code in rust
I use whatever language makes the most sense for a given project. I've seen both spaghetti and well-written code in both Java and Python. The fight is imaginary.
Yeah lol. I've faced issues in Java and python, and rust, and JS, and C#. Every language is a pain if you dive deep enough. It's just pick your poison
I can write shitty spaghetti code in over 12 languages and can reinvent the wheel in all modern frameworks.
Ready for management
I can prompt 12 AI models with "fix it" and get even more broken features in more code files
Ready for production
Haha, that's so real.
Me in my cozy corner doing x64 Assembly watching all programming languages burn :0
Just curious, what do you use assembly for currently? I was thinking about trying it for fun but never tried it
I like java
I love python
Dep mgmt is tremendously uncomplicated 99% of the time and once you dig under the hood a few times it's very concrete and predictable.
That said my local machine (personal desktop) is a disaster area loool I need to rip my installations out and re do it
Just a friendly reminder that Python is actually older than Java.
Java stack traces may be long, but if you cannot find where the error is and how it moves from it, the problem is you.
Java 21 has 2 lines of boilerplate now
Long live Kotlin.
To be fair doing something like installing all the modules for python gui setup without an environment manager like anaconda to manage all the conflicting dependencies is truly painful and you will break everything.
But on the other hand curly braces, nah.
I heard that you liked Factory
so I put a FactoryFactory in your FactoryFactoryFactory
So you can FactoryFactoryFactoryFactory while you FactoryFactoryFactoryFactoryFactory
I've never understood how the whole FactoryFactory joke was about Java as a language. Isn't that just a development pattern that everyone is welcome to not follow?
I'm not entirely sure why it's so prevalent in Java but no other language regularly passes this sort of shit off with a straight face: https://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProcessorFactoryFactory.html?rel=html
Why do anti Python memes always reference bullshit that's not really an issue for anyone other than first month students
Because that's exactly the same for all other languages as well.
The last time I had a dependenc problem was...yeah, wait a sec...ah yes, before containers became a thing 😎
Because needing to ship better half of linux userland, buch of esoteric machinery to configure C groups and user permissions and depending on the underlying platform entire linux vm is a sign of a language that doesn’t have dependency management problem.
is a sign of a language that doesn’t have dependency management problem.
Pretty sure I never said that.
Pythons dependency management is a mess. So is its handling of multiple interpreter versions and isolation of runtime environments. I am merely stating that there is a widespread, easy-to-use way around these problems.
And besides, thanks to the good folks who make uv
even managing dependencies directly on the host system is nowadays a far cry from the PITA it used to be.
You know the number one sign of a disorganized dev who doesn’t know what they’re doing? Crying over package dependencies.
Keep your shit clean and organized bozos.
And if you use conda then you deserve the pain - that is a disaster of a project.
Yeah sorry, It was my fault for not knowing that x package was using numpy 1.8.9 and y package was using numpy 2
Requirements.txt has left the chat.
Im not a big python user but acting like dependency management is much easier in java is a little silly.
I would love to have Java stack traces only 10 layers deep. But that explains millions of stack traces in Java apps. Java developers don't look into log files.
With the well known logging frameworks you can do this yourself.
Java supplies you with the full stack trace, you can decide what and where to log.
And Java devs look into log files if they do the ops part as well, which is common for DevOps.
I've been using Python professionally for about 8 years now and I've got to say that you guys complaining about all of these errors are really just telling everyone that you are bad at using Python rather than saying anything substantial about Python. I can only infer that Java is some kind of beginner friendly baby's first language if you're holding down a job as a Java dev but can't even manage a Python venv or figure out how to resolve a ModuleNotFound error without breaking down in tears lol
I thought node_modules was bad until I encountered python dependency management.
Utterly insane.
A meme from 15 years ago lmao. This is not a problem with python today.
Docker up your pip packages and use that image as your base lambda layer.
I'll take the headache of dealing with pip packages over companies still running applications on java8 and maven versions that would make a cobalt dev proud
Python is a magical language. It lets you experience syntax errors when you're not even developing, just trying to run someone else's software.
Node developer rolling the dice on npm update of a 6 months old setup.
It always amazes me how people love all these languages with all this bad tooling/env setup.
Meanwhile you have languages like rust, go, swift that you can pretty much get up and running with a single command to fetch all your dependencies.
It might be because you can build a CNN in an afternoon with like five imports and python
Rust and Java always amazed me with their library management. I love cargo and Maven. Haven't used swift tho
Meanwhile you have languages like rust, go, swift that you can pretty much get up and running with a single command to fetch all your dependencies.
Rust and Go, those I get, but there is none who can convince me that the swift build system isn’t giant pain in the ass, which involves ceremony after ceremony to actually get going.
never had those problems so skill issue?
If you don't mind, what projects have you created with python as the primary language?
Mostly computer vision, wrote the backend for my masters thesis with it for web based ar
Ah, nice
Developed on windows? I had a fairly decent experience on windows with python.
But on embedded Linux I just face way too many issues, and it's always pip and some dependency issue
I did the dev work on windows but deployed on Linux (and eventually WSL b/c aws pricing sucks for gpu) so I have experience with both, including getting cuda to work. One of my hobby projects involves running a VLM from source so I can pull out the image embeddings, which was kind of messy too, but I didn't have any package issues that were hard to fix. I did have some trouble with the versioning of the data annotation tool I used b/c it was old but setting the version worked. I had more trouble with packages for the frontend (react js and threeJS)
Ah, so you're blaming Python because you couldn’t handle dependency management on embedded Linux? Bro, that’s not a language issue, that’s a you didn't read the docs issue. Python didn’t fail — your setup did. Try using venv and poetry before throwing shade, champ.
"Read the docs" yes my friend, the docs asked me to run the code in python. The docs made me install certain libraries and they didn't work out, I had to make them work. You should at least know python and C are preferred for embedded Linux, and most documentation suggest it. If you're gonna come at me, at least come with proper facts, rather than a reply copied from chatGPT 🙃
If you are struggling with that list you are way way WAY too green to even start joking about other languages...
Haha Java homies rise up. I've created my own library over the last 8 years that handles all my boilerplate stuff. If I want to store a POJO in a file I just add @JsonManager("file_path.json"). There's other formats as well..
Then you just do XillaAPI.getObject(YourObject.class, "id")
And I use maven for dependency management myself.
My man 🤜🤛
Managing Gradle and maven is actually much more a mess than python dependencies that are really easy to manage with tool like uv or pyenv
Tell me you are new to python without telling me you are new to python.
I'm fine with some shit talking but come on, these are issues that no python dev encounters past their first month with the language.
But I mean I understand. In Java you need the first month to write all the boilerplate for the damn thing to even build.
Is that the thing from 2010's?
bash
uv init
uv venv --python 3.12
uv add yourmodule
If it's hard for you, you are either a first year student or it's better for you to quit software development. Give up. You can't handle a few cli commands
Or you can proceed to code using Java 8 in the cave idk
Btw, using conda is a skill issue too
It's a thing from 2020's
Post controversial meme in a meme subreddit
Rage bait people
People get rage baited
If it's hard for you to understand this, you are either new to the internet, or its better to get off meme subreddits. Give up. You can't handle a reused joke
Or you can proceed to get angry at all the obvious rage baits
Btw, not getting a joke is a skill issue too
Taking seriously any reply with "skill issue" is a massive skill issue. Another proof this post worth nothing, even as rage bait
Ez uncovered
uv ftw
uv gang
[deleted]
Just in case what...?
uv
works.Good luck using uv with pytorch and dependencies that depend on torch, spoiler: it's not fun.
But to be fair, that's not uv fault as it's also a nightmare with poetry or any other standard package manager/resolver. It's an issue of python's dependency resolution when it comes to GPUs
I only use Python (and by extension, uv) for local AI stuff, and I haven't had a single problem with Torch. I'm also a complete Python luddite. What's wrong with uv and Torch?
Is there an official doc for how to structure projects using UV?
A while ago I tried and the lack of structure and proper documentation was quite disturbing.
No offense, but that tells me you haven't ever read the uv docs... https://docs.astral.sh/uv/guides/projects/
unsure what exactly you are looking for there, especially in comparison to pip
For example: what should I use? - requirements.txt - pyproject.toml - uv lock file
pyproject toml, lock file is generated. No need for requirements.txt
when in a project just do uv init. it generates a starting point. add dependencies with uv add, apply them with uv sync
generally you shouldn't have to interact with locking and syncing in UV. uv will update your lock file when you
add
andremove
. It will also create/enter venvs and sync environments when yourun
.No, it will update the toml when adding and removing packages. It will update the lock file when you sync or run.
Never used UV, how is it better than pip?
way more solid and super fast dependency resolution. I was reluctant to switch for a hot minute but not looking back.
While it's great, it has the same issue where it can't resolve package versions if your packages didn't specify their dependencies correctly.
tells you right away if two packages have conflicting dependencies and tells you, in seconds, its great.
I was gonna say. Uv for hobby, poetry for work. Biggest issue is installing poetry honestly.
And it's slower. And doesn't take care of python version. Why would you use an inferior tool for work? Given the choice I always go for uv in new projects.
Poetry does work with versioning if you use py-env cli tool and set some flags in your poetry config. Just not natively in the tool itself.
We don't use UV cause our head SE said so. They experimented with uv before I got there and for one reason of another they decided to stick to poetry.
depending on when they looked at it, that could be fair enough. But UV has been iterating and updating so rapidly, if they checked 6 months ago then chances are UV is up to their standard now. It could however be some weird internal tooling integration like in my org, if that's the case then you just have to wait...