Wrote some notes on Aider's unconventional but kind of brilliant installation mechanism, which solves the "isolated Python virtual environment" problem by bundling uv as a dependency! simonwillison.net/2025/Mar/6/a

Follow

@simon That still requires you to `pip install` something in some environment, no? I feel like having a random installer with a dependency on `uv` in your (system?) python is not a good side-effect of this.

Better to have people install `pipx` and then use that to install your CLI tool. It's got the same "now pipx has to live in my global system directory" problem, but at least `pipx` is the *only* think you need there.

@simon The biggest problem I think people have and possibly will continue to have is "where do I get my Python". The system python is not a good thing to use for random stuff.

I haven't looked much into how `uv` handles installing and managing Python versions for you, but if it's halfway decent, then you probably don't want to abstract over that anyway, you want to tell people, "Install `uv` as a system package, then use it to install `aider`".

@pganssle @simon If it were me, I'd bootstrap it with UV and let it pick up the version of Python you want. You could even bootstrap it or shebang it if you needed a more complex build.

@webology @simon I mean you don't have to bootstrap if you have uv, right? Install uv, possibly `uv python install`, then `uv tool install <my tool>`.

@pganssle that's what I think is clever about the Aider trick: if you DO have at least something that runs when you type "python" it can bootstrap a Python 3.12 that works well from that

There are other options (including curl script one) provided too, but the uv dependency one is a particularly neat way of NOT having to teach people about system packages, uv, environments etc

@pganssle @simon Some of us have plans/hopes to create relocatable builds of CPython that are available from python.org, but it takes time and effort.

@simon I agree, hence why it's #8 on my personal Python "Big Plans" list.

@brettcannon @pganssle @simon if somebody starts working on this, pypy has been doing this for years on a bunch of platforms, we'd be happy to help out

@cfbolz @pganssle @simon There's some talk on the python-dev Discord if you happen to have access via HPy or something, but right now it's mostly python-build-standalone trying to get BOLT working.

@brettcannon @pganssle @simon I think that would be a splendid thing! Where can I participate and help with this?

@jezdez @cfbolz Zanie from Astral is working to upstream some of the patches from github.com/astral-sh/python-bu, you could contact them there or in the Astral Discord.

@brettcannon @pganssle @simon

@pganssle @simon The Python handling is decent (while I use it via PDM rather than uv, it's the same python-build-standalone mechanism that I've recommended elsewhere underneath). uv also has pipx style functionality built in to it.

@pganssle @simon fwiw the `uv tool` that aider uses is basically `pipx`, with the same isolation. the python-build-standalone that uv installs if a matching system python is missing also blocks you from installating into the "system" environment to enforce that isolation.

@konstin @simon Yeah, I have been using `uv` a bit more lately. My objection here is that I didn't think this "pip install a thing that installs and calls uv" is buying you anything.

The person needs to know enough to use pip, then the installer itself gets installed into some global environment, just to install uv into that same environment?

I don't think that anyone willing to use pip will have a hard time with uv, and it seems that uv has a much better "default" experience for people uninterested in finding out what is going on under the hood.

@pganssle @konstin honestly I think this is mostly about aesthetics

A README that says this:

python -m pip install aider-install
aider-install

Is very slightly less intimidating than one that says this:

python -m pip install uv
uv tool install aider-chat --python 3.12

In the second case you need to explain more steps

@simon @konstin Both of those assume that you have pip and also Python, which is already too late to be doing it "right", so you may as well not recommend pip installing it at all, or just say, "this can be installed with pip or uv" or something.

Alternatively, you could just say, "Easiest way to install is uv tool install aider-chat", possibly with a link on how to install uv. I personally would be installing uv as a top level tool through the OS.

One of the bigger problems with the system install is that it moves when Python updates, which I suspect will break a pip installed uv, but it wouldn't be a problem for a system installed uv.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.