xkcd #1987: Python Environment

Jason Novinger@programming.dev to Programmer Humor@programming.dev – 22 points –
Python Environment
xkcd.com
23

Download ML thing.
make new venv.
pip install -r requirements.txt.
pip can't find the right versions.
pip install --update pip.
pip still can't find the right versions.
install conda.
conda breaks for some reason.
fix conda.
install with conda.
pytorch won't compile with CUDA support.
install 2,000,000GB of nvidia crap from conda.
pytorch still won't compile.
install older version of gcc with conda.
pytorch still won't compile.
reinstall the entire operating system with debian 11.
apt can't find shitlib-1.
install shitlib-2.
it's not compatible with shitlib-1.
compile it from source.
automake breaks.
install debian 10.
It actually works.
"Join our discord to get the model".
give up.

It feels like you stood behind me yesterday, taking notes.

thats when you do

/usr/bin/python3.11 -m pip install

mother. fucking. hardcoded paths. 1 step forward, 10 steps backward.

Feels very validating to see that everyone else's Python is held together by a thread too.

Don't forget poetry!

I started using poetry on a research project and was blown away at how good it is. Next week I start a new job and I am hoping it is the standard.

Thank god for NixOS. (My daily on my laptop, seriously flakes + nix-direnv is godsend for productivity. Reliable development environments and I don’t have to lift a finger!)

Do you have any troubles running it as your daily OS? Do you use it as your hobby or also for your work?

I know Nix and use it as my package manager, but I'm not sure about the experience with NixOS. So I'm still reluctant to make the switch.

I've recently discovered pipenv, and it has been a massive QoL improvement. No need to figure out bazillion of commands just to create or start an environment, or deal with what params should you use for it like you do with venv. You just pipenv install -r requirements.txt, and everything is handled for you. And when you need to run it, just pipenv run python script.py and you are good to go.

The best thing however are the .pipfiles, that can be distributed instead of requirements.txt, and I don't get why it's not more common. It's basically requirements, but directly for pipenv, so you don't need to install anything and just pipenv run from the same folder.

I've been burned by pipenv before on a large project where it was taking upwards of 20 minutes to lock dependencies. I think these days they use poetry instead, but I've heard the performance is still not very scalable

With that said, I think it can be a nice addition, but I think it comes down to Python packages not really taking dependency management as a top priority instead of favoring flexibility. This forces a package manager to download and execute the packages to get all the dependency information. Naturally, this is a time-consuming process if the number of packages is large.

On multiple instances I've seen projects abandon it for pip and a requirements.txt because it became unmanageable. It's left a bad taste in my mouth. I don't like solutions that claim to solve problems but introduce new ones.

Hopefully Mojo will sort it all out. Maybe even inspiring a new, positive streak of xkcd strips in the future?

This is useless. Why don't you start a community for google searches?

I didn't start it.

I joined it, and linked it, because I liked getting my xkcd's in my reddit feed from r/xkcd, because that meant there were comments to engage with. How the fuck is that useless? Why the animosity?

Like actually, how is the mere mention of a community enough for you to turn mean?

Edit: Wow. You're an instance admin. Is this how you conduct yourself? Do you go deleting communities created by users on your instance, if you don't personally see value in them?

Sorry to have been so mean. I simply think starving a website of visits is not great.

Do you go deleting communities created by users on your instance, if you don’t personally see value in them?

That is one hell of a jump to conclusions.

Honestly, at this point I'm running all my python environments in different docker containers. Much easier to maintain.

Wait, you guys don't have a vm for each project and just use ssh to work on them?

I wish I could do that, but my employer switches me around so much that I'd be out of disk space in no time.