Lurker News

Comments (227) 39 threads

Show all comments

Showing thread 3 of 39

sabellito11 replies#
Every time I see these things, they look cool as hell, I get excited, then I try to get them working on my gaming PC (that has the GPU), I spend 1-2h fighting with python and give up.

Today's issue is that my python version is 3.12 instead of <3.12,>=3.9. Installing python 3.11 from the official website does nothing, I give up. It's a shame that the amazing work done by people like the OP gets underused because of this mess outside of their control.
"Just use docker". Have you tried using docker on windows? There's a reason I never do dev work on windows.
I spent most of my career in the JVM and Node, and despite the issues, never had to deal with this level of lack of compatibility.

jhoho5 replies#
Let me introduce you to the beautiful world of virtual environments. They save you the headache of getting a full installation to run, especially when using Windows.

I prefer miniconda, but venv also does the job.

regularfry4 replies#
Virtual environments with venv don't answer the python version problem unless you throw another tool into the mix.
underdeserver2 replies#
Hmm? My venvs do include the Python version (via symlink to /bin). Don't yours?
diggan#
If you use something like uv (expanded here: https://news.ycombinator.com/item?id=43904078), I think it does. But if you just do `python -m venv .venv`, you get the specific version you used to create the virtual environment with. Some OSes seem to distribute binaries like `python3.8`, `python3.9` and so on so you could do `python3.8 -m venv .venv` to look one env to a specific version, but a bit of a hassle.
regularfry#
The GP's problem was (apparently) an inability to install the right python version, not an inability to select it.
laborcontract#
uv solves this problem.

  uv venv python3.11
done.
homeless_engi#
Conda does! `conda create -n myenv python=3.9`, for example
krferriter#
conda and uv do manage python versions for you which is part of their appeal, especially on systems that don't make it super straightforward to install multiple different versions of pre-compiled runtimes because their official OS channel of installing python only offers one version. At least on macos, brew supports a number of recent versions that can be installed simultaneously.
s5ma6n1 reply#
I am also using conda and specifically mamba which has a really quick dependency solver.

However, sometimes repos require system level packages as well. Tried to run TRELLIS recently and gave up after 2h of tinkering around to get it to work in Windows.
Also, whenever I try to run some new repo locally, creating a new virtual environment takes a ton of disk space due to CUDA and PyTorch libraries. It adds up quickly to 100s of gigs since most projects use different versions of these libraries.
Sorry for the rant, can't help myself when it's Python package management...

WanderPanda#
Same experience. They should really store these blobs centrally under a hash and link to them from the venvs
turnsout1 reply#
And this works about 25% of the time. The rest of the time, there is some inscrutable error with the version number of a dependency in requirements.txt or something similar, which you end up Googling, only to find an open issue on a different project's Github repo.

Someone needs to make an LLM agent that just handles Python dependency hell.

releaslot1 reply#
"Someone needs to make an LLM agent that just handles Python dependency hell."

This is why they are constantly delaying GPT 5.

Continue this thread — 1 reply

mckeed#
As someone who doesn't develop in python but occasionally tries to run python projects, it's pretty annoying to have to look up how to use venv every time.

I finally added two scripts to my path for `python` and `pip` that automatically create and activate a virtual env at `./.venv` if there isn't one active already. It would be nice if something like that was just built into pip so there could be a single command to run like Ruby has now with Bundler.

krferriter1 reply#
`uv` is great for this because its super fast, works well as a globally installed tool (similar to conda), and can also download and manage multiple versions of python for you, and which version is used by which virtualenvironment.
Grimblewald#
While my uv use is still early days, i would second this recommendation. I've found it to have the functionallity i miss from conda in venv, but faster and more reliable than conda.
atoav2 replies#
uv is the way.

https://docs.astral.sh/uv/
Sadly it appears that people in the LLM space aren't really all that good at packaging their software (maybe, on purpose).

diggan3 replies#
> Sadly it appears that people in the LLM space

This seems to be somewhat of a Python side-effect, same goes for almost any Python projects thrown together by people who hasn't spent 10% of their life fighting dependency management in Python.
But agree with uv being the best way. I'm not a "real" Python programmer, similar boat to parent that I just end up running a bunch of Python projects for various ML things, and also create some smaller projects myself. Tried conda, micromamba, uv, and a bunch of stuff in-between, most of them breaks at one point or another, meanwhile uv gives me the two most important things in one neat package: Flexible Python versions depending on project, and easy management of venv's.
So for people who haven't given it a try yet, do! It does make using Python a lot easier when it comes to dependencies. These are the commands I tend to use according to my history, maybe it's useful as a sort of quickstart. I started using uv maybe 6 months, and this is a summary of literally everything I've used it for so far.

    # create new venv in working directory with pip + specific python version
    uv venv --seed --python=3.10
    # activate the venv
    source .venv/bin/activate
    # on-the-fly install pip dependencies
    uv pip install transformers
    # write currently installed deps to file
    uv pip freeze > requirements.txt
    # Later...
    # install deps from file
    uv pip install -r requirements.txt
    # run arbitrary file with venv in path etc
    uv run my_app.py
    # install a "tool" (like global CLIs) with a specific python version, and optional dependency version
    uv tool install --force --python python3.12 aider-chat@latest
amelius2 replies#
For security maybe you should do all of this inside a sandbox.

Continue this thread — 2 replies

whacked_new2 replies#
does uv play well with cuda?

I use nix-shell when possible to specify my entire dev environment (including gnumake, gcc, down to utils like jq)
it often doesn't play well with venv and cuda, which I get. I've succeeded in locking a cuda env with a nix flake exactly once, then it broke, and I gave up and went back to venv.
over the years I've used pip, pyenv, pip env, poetry, conda, mamba, younameit. there are always weird edge cases especially with publication codes that publish some intersection of a requirements.txt, pyproject.toml, a conda env, to nothing at all. There are always bizarro edge cases that make you forget if you're using python or node /snark
I'll be happy to use the final tool to rule them all but that's how they were all branded (even nix; and i know poetry2nix is not the way)

Continue this thread — 2 replies

bb883 replies#
There's been a movement away from requirements.txt towards pyproject.toml. And commands like "uv add" and "uv install" take most of the pain of initializing and maintaining those dependencies.

Continue this thread — 3 replies

scld#
Probably because they're just prompting "Please package this software" and shipping it if it works once.
ijustlovemath#
I've had a lot of success using podman with pyenv for python versions, and plain old venv for the actual environment. All of this lives within WSL, but you can still access everything locally with localhost://

If you just want to use windows, pyenv-win exists and works pretty well; just set a local version, then instantiate your venv.
uv does certainly feel like the future, but I have no interest in participating in a future VC rugpull.

marziply#
Don't use Bindows then? The tech industry is largely focused on Unix systems so of course there will be inevitable sharp edges when you work on a garbage system like Bindows...
zo12 replies#
Do you know how much time I (or any other dev) would spend getting a C#, or C++, or JS/TS, or Java or any language project running that has anything to do with ML up and running on tech and tooling we are kinda unfamiliar with? Yes, pretty much 1-2 hours, and very likely more.

Sorry but this sort of criticism is so contrived and low-effort. "Oh I tried compiling a language I don't know, using tooling I never use, using an OS I never use (and I hate too btw), and have no experience in any of it, oh and on a brand-new project that's kinda cutting-edge and doing something experimental with an AI/ML model."
I could copy-paste your entire thing, replace Windows with Mac, complain about homebrew that I have no idea how to use, developing an iMac app using SwiftUI in some rando editor (probably VSCode or VI), and it would still be the case. It says 0 about the ecosystem, 0 about the OS, 0 about the tools you use, 0 about you as a developer, and dare I say >0 about the usefulness of the comment.

TeamDman#
Python dependency management sucks ass. Installing pytorch with cuda enabled while dealing with issues from the pytorch index having a linux-only version of a package causing shit to fail is endlessly frustrating

A good ecosystem has lockfiles by default, python does not.

zamadatix#
For development is one thing, the problem is with this being how the LLM app distribution for general use works too.

Continue this thread — 6 more replies