rye
rye copied to clipboard
Opaque "Unable to determine target virtualenv Python version" running `rye sync` in `ruff` repo
Steps to Reproduce
- I have
[email protected]
toolchain (only) installed in rye -
git clone [email protected]:astral-sh/ruff && cd ruff
-
rye sync
Expected Result
I expected rye sync
to create a 3.12.2 env (but perhaps this was a wrong expectation? new rye user), or else to fetch some other version and create a virtualenv with that
Actual Result
error: Unable to determine target virtualenv Python version
This error doesn't offer much to go on in debugging the issue. What versions did Rye consider? Why did it reject them? What can I do to fix the issue? I looked for an option to rye sync
to specify the python version and didn't find one. Eventually I found a reference to .python-version
and echo "3.12.2" > .python-version
fixed the issue.
@zanieb pointed out that the error is coming from here: https://github.com/astral-sh/rye/blob/ebd947dbc67b9950a3a65571caca86c881a5d347/rye/src/pyproject.rs#L1153-L1178
Version Info
➜ rye --version
rye 0.31.0
commit: 0.31.0 (72e239b8f 2024-03-22)
platform: macos (aarch64)
self-python: [email protected]
symlink support: true
uv enabled: true
Stacktrace
No response
use rye pin [email protected]
instead of echo "3.12.2" > .python-version