uv pip install --python <version>
doesn't perform automatic Python downloads
#12229
Labels
bug
Something isn't working
Summary
Hi,
Firstly, thank you for your incredible work and vision with
uv
and Astral as a whole.I'm not entirely sure whether this is a bug or intended behaviour (if so, perhaps an extra note in the documentation would suffice). I've also tried to find existing issues that match the symptoms but haven't found any.
My use case is packaging dependencies into a zip archive for deployment to AWS Lambda via Terraform. Following the guide on https://docs.astral.sh/uv/guides/integration/aws-lambda/ is very helpful, particularly with the
--target <target dir>
feature as we previously used it withpip install
directly. However, when the desired Python version doesn't exist on the system,uv
doesn't attempt to download it.My expectation was for
uv
to automatically download the missing Python version as it does with the majority of otheruv
workflows. Although, I can see this might intentionally not be the case with the "pip compatibility" layer as managing Python versions is not something thatpip
concerns itself with.Is this the intended behaviour? I can of course run something like
uv python install python3.13
before running the install command to make sure it's always present, or bake Python 3.13 into my Terraform agent itself. However, the way thatuv
usually manages to automatically download missing Python versions is a really great feature that I've come to rely on to as it removes the need to prepare system wide dependencies etc.Steps to reproduce the bug
With a fresh clone of https://github.com/astral-sh/uv-aws-lambda-example, following the "Zip archive" steps at https://github.com/astral-sh/uv-aws-lambda-example?tab=readme-ov-file#zip-archive works as written assuming you already have Python 3.13 installed.
If you remove it first, the commands fail:
Hope that all makes sense and thanks again.
Cheers,
Kyle
Platform
Ubuntu 22.04 x86_64
Version
uv 0.6.6
Python version
Python 3.13
The text was updated successfully, but these errors were encountered: