| > 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
|