This works way better than pip, as it does more checks/dependency checking, so it does not break as easily as pip, though this makes it definitely way slower when installing something. It also supports updating your environment to the newest versions of all packages.
It's no silver bullet and mixing it with pip leads to even more breakages, but there is pixi [0] which aims to support interop between pypi and conda packages
- If they're so good at dependency management, why is Conda installed through a magical shell script?
- It's slow as molasses.
- Choosing between Anaconda/Miniconda...
When forced to use Python, I prefer Poetry, or just pip with freezing the dependencies.
The Python people probably can't even imagine how great dependency management is in all the other languages...
> The Python people probably can't even imagine how great dependency management is in all the other languages...
Yep, I wish I could use another language at work.
> Choosing between Anaconda/Miniconda...
I went straight with mamba/micromamba as anaconda isn't open source.
This happened about a week ago
Funnily, the only real competitor for Nvidias' GPUs are Macbooks with 128GB of RAM.
(I don't do most of my work locally, but for smaller models its pretty convenient to work on my mbp).
I'm an Applied Scientist vs. ML Engineer, if that matters.
Conda.. it interfere with OS setup and has not always the best utils. Like ffmpeg is compiled with limited options, probably due to licensing.
It causes so many entirely unnecessary issues. The conda developers are directly responsible for maybe a month of my wasted debugging time. At my last job one of our questions for helping debug client library issues was “are you using conda”. And if so we just would say we can’t help you. Luckily it was rare, but if conda was involved it was 100% conda fault somehow, and it was always a stupid decision they made that flew in the face of the rest of the python packaging community.
Data scientist python issues are often caused by them not taking the 1-3 days it takes to fully understand their tool chain. It’s genuinely quite difficult to fuck up if you take the time once to learn how it all works, where your putbon binaries are on your system etc. Maybe not the case 5 years ago. But today it’s pretty simple.
The interminable solves were awful. Mamba made it better, but can still be slow.
Plenty of more esoteric packages are on PyPI but not Conda. (Yes, you can install pip packages in a conda env file.)
Many packages have a default version and a conda-forge version; it's not always clear which you should use.
In Github CI, it takes extra time to install.
Upon installation it (by default) wants to mess around with your .bashrc and start every shell in a "base" environment.
It's operated by another company instead of the Python Software Foundation.
idk, none of these are deal-breakers, but I switched to venv and have not considered going back.
All of a sudden you have people with C problems, who have no idea they're even using compiled dependencies.
It's not really much of a counterargument to say that Python is good enough that you don't have to care what's under the hood, except when it breaks because C suck so badly.
I never experienced CPython itself segfault, it's always due to some package.
The point is the same - we had it simpler and now, with all capabilities for automation, we have it more complex.
Frankly, I suspect most of the efforts now are spent fighting non-essential complexities, like compatibilities, instead of solving the problem at hand. That means we create problems for ourselves faster than removing them.
Your comment makes me feel a little better that this is not merely some personal failing of focus, but happens in a professional setting too.
For hobby stuff at home though I don't tend to hit those types of issues because my projects are pretty frozen dependency-wise. Do you really have OS updates break stuff for you often? I'm not sure I recall that happening on a home project in quite a while.
It’s why I still use react, their backcompat is amazing
or pyenv at least
>Something something incorrect cpu architecture for your Macbook
I’m glad I have something in common with the smart people around here.
Surely work can provide that?
[0] https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1...
Although I think the UX of poetry is stupid and I do not agree with some design decisions, I have not had any dependency conflicts since I used it.
To avoid spending hours on fixing broken environments after a single "pip install", I would make it easy to rollback to a known state. For example, recreate virtualenv from a lock requirements file stored in git: `pipenv sync` (or corresponding command using your preferred tool).
Half of the problems I've helped some people solve stem from python devs insisting on shuffling std libraries around between minor versions.
Some libraries have a compatibility grid with different python minor versions, because how often they break things.
Since then the whole python ecosystem has gotten worse.
We are building towers on quicksand.
It's not about python, it's about people who don't care about dependencies.
13 years ago when I was trying to explore the field R seemed to be the most popular, but looks like not anymore. (I didn't get into the field, and do just a regular SWE, so I'm not aware of the trends).
There is also a lot of development in Elixir ecosystem around the subject [1].
[1](https://dashbit.co/blog/elixir-ml-s1-2024-mlir-arrow-instruc...)
There are Microsoft-backed F# bindings for Spark and Torch, but no one seems interested. And this is despite a pretty compelling proposition of lightweight syntax, strong typing, script-ability and great performance.
The answer will probably be JavaScript.
Everyone already knows the language - all that's missing is operator overloading and a few key bindings.
For exactly the reasons your mentioned, i feel like F# would have been the perfect match for both MLE/ETL(spark pipeline) work and some of the deep learning/graph modelisation such as pytorch. Saddly, even from MSFT, the investment in F# as dried up
Why is python dependency management so cancerously bad? Why are there so many “solutions” to this problem that seem to be out of date as soon as they exist?
Are python engineers just bad, or?
(Background: I never used python except for one time when I took a coursera ML course and was immediately assaulted with conda/miniconda/venv/pip/etc etc and immediately came away with a terrible impression of the ecosystem.)
- You can’t have two versions of the same package in the namespace at the same time. - The Python ecosystem is very bad at backwards compatibility
This means that you might require one package that requires foo below version 1.2 and another package that requires foo version 2 and above.
There is no good solution to the above problem.
This problem is amplified when lots of the packages were written by academics 10 years ago and are no longer maintained.
The bad solutions are: 1) Have 2 venvs - not always possible and if you keep making venvs you’ll have loads of them. 2) Rewrite your code to only use one library 3) Update one of the libraries 4) Don’t care about the mismatch and cross your fingers that the old one will work with the newer library.
Most of the tooling follows approach 1 or 4
I threw it online at https://github.com/fragmede/python-wool/
Now your 15 venvs deep, and have over 3000 different package version combinations installed. Your job is to upgrade them right now because of a level 8 CVE
for venv in $(find ~/projects/ -type d -name 'venv'); do
(
source ${venv}/bin/activate
pip install --upgrade pip
pip install --upgrade package_with_cve
deactivate
) &
done
should do the trick. Sucks that we're in that world, but let's not work any harder than we have to.pyenv for installing and managing python versions.
direnv for managing environments and environment variables (a highly underrated package imo).
With those two installed I just include a .envrc file in every project. It looks like this:
layout python ~/.pyenv/versions/3.11.0/bin/python3
export VARIABLE1=variable1
export VARIABLE2=variable2
etc...
PYTHONPATH="`pwd`/venv/lib/python-3.11/site-packages"
or whatever in .envrc and Bob's your uncle.The ML system is a whole another stack of problems. The elephant in the room is Nvidia who is not known for playing well with others. Aside from that, the state of the art in ML is churning rapidly as new improvements are identified.
I can only imagine it seemed like an oasis to R which is bottom tier.
So when you combine data scientists, academics, mathematicians, juniors, grifters selling courses…
things like bad package management, horrible developer experience, absolutely no drive in the ecosystem to improve anything beyond the “pinnacle” of wrapping C libraries are all both inevitable and symptoms of a poorly designed ecosystem.
> Something something incorrect cpu architecture for your Macbook
Environment broken
Spend 4 hours fixing python environment
pip install Pillow
Something something incorrect cpu architecture for your Macbook
Spend another 4 hours reinstalling everything from scratch after nuking every single mention of python
pip install … oh time to go home!