Skip to content

Python preference option system disables python downloads #8804

@Olindholm

Description

@Olindholm

I would like uv to prioritize using system python when possible, but download a managed python version if necessary.

I figure using the --python-preference system option (or export UV_PYTHON_PREFERENCE=system) would do this. However it seems when using that, downloads are disabled.

$ uv python list
cpython-3.13.0+freethreaded-linux-x86_64-gnu    <download available>
cpython-3.12.7-linux-x86_64-gnu                 <download available>
cpython-3.11.10-linux-x86_64-gnu                <download available>
cpython-3.10.15-linux-x86_64-gnu                <download available>
cpython-3.10.12-linux-x86_64-gnu                /usr/bin/python3.10
cpython-3.10.12-linux-x86_64-gnu                /usr/bin/python3 -> python3.10
cpython-3.10.12-linux-x86_64-gnu                /usr/bin/python -> python3
cpython-3.10.12-linux-x86_64-gnu                /bin/python3.10
cpython-3.10.12-linux-x86_64-gnu                /bin/python3 -> python3.10
cpython-3.10.12-linux-x86_64-gnu                /bin/python -> python3
cpython-3.9.20-linux-x86_64-gnu                 <download available>
cpython-3.8.20-linux-x86_64-gnu                 <download available>
cpython-3.7.9-linux-x86_64-gnu                  <download available>
pypy-3.10.14-linux-x86_64-gnu                   <download available>
pypy-3.9.19-linux-x86_64-gnu                    <download available>
pypy-3.8.16-linux-x86_64-gnu                    <download available>
pypy-3.7.13-linux-x86_64-gnu                    <download available>
$ uv venv --python 3.8 --python-preference system --verbose
DEBUG uv 0.4.29
DEBUG Searching for Python 3.8 in managed installations or system path
DEBUG Found `cpython-3.10.12-linux-x86_64-gnu` at `/usr/bin/python` (search path)
DEBUG Skipping interpreter at `/usr/bin/python` from search path: does not satisfy request `3.8`
DEBUG Found `cpython-3.10.12-linux-x86_64-gnu` at `/usr/bin/python3` (search path)
DEBUG Skipping interpreter at `/usr/bin/python3` from search path: does not satisfy request `3.8`
DEBUG Found `cpython-3.10.12-linux-x86_64-gnu` at `/bin/python` (search path)
DEBUG Skipping interpreter at `/bin/python` from search path: does not satisfy request `3.8`
DEBUG Found `cpython-3.10.12-linux-x86_64-gnu` at `/bin/python3` (search path)
DEBUG Skipping interpreter at `/bin/python3` from search path: does not satisfy request `3.8`
DEBUG Searching for managed installations at `/home/olindho1/.local/share/uv/python`
DEBUG Skipping incompatible managed installation `cpython-3.12.6-linux-x86_64-gnu`
  × No interpreter found for Python 3.8 in managed installations or system path

I don't see this behavior being described anywhere. Is this intentional or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions