You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using uv sync, uv fails to find a python interpreter even if it exists if the default python/python3 are incompatible. This happens e.g. with pyenv.
For example with both requires-python = "==3.10.*"requires-python = ">=3.10", where the default python/python3 are any other version, say 3.9:
This fails:
uv sync --python-preference only-system
This passes:
uv sync --python-preference only-system -p 3.10
uv should find the python 3.10 interpreter in either case.
Reproduction
FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -yy build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
RUN curl https://pyenv.run | bash
ENV PATH="/root/.pyenv/bin:$PATH"RUN CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.8.12 3.8.18
RUN CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.9.18
RUN CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.10.13
RUN CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.11.7
RUN CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.12.1
RUN pyenv global 3.8.12 3.8.18 3.9.18 3.10.13 3.11.7 3.12.1
# https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenvRUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc
Create a dummy pyproject.toml, any requires-python that mismatches the default active python will do:
[project]
name = "a"version = "0.1.0"requires-python = "==3.10.*"dependencies = ["tqdm"]
is there anything new on this, because is is a major show stopper for using uv in my opinion. even on modifying lock and toml uv sticks with default system version of python. furthermore, a just initialized venv with the right python is removed and replaced by the wrong python.
When using
uv sync
, uv fails to find a python interpreter even if it exists if the defaultpython
/python3
are incompatible. This happens e.g. with pyenv.For example with both
requires-python = "==3.10.*"
requires-python = ">=3.10"
, where the defaultpython
/python3
are any other version, say 3.9:This fails:
This passes:
uv should find the python 3.10 interpreter in either case.
Reproduction
Create a dummy pyproject.toml, any
requires-python
that mismatches the default active python will do:Compile uv:
Start the docker container, mount the uv dir to
/io
and run commands withThe text was updated successfully, but these errors were encountered: