astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
25.4k stars 739 forks source link

No interpreter found for path `C:/Users/USERNAME/miniforge3/envs/my-custom-env/python` in managed installations, system path, or `py` launcher #7619

Open kdheepak opened 1 month ago

kdheepak commented 1 month ago

I'm unable to run uv sync --python=$(which python) on Windows. I'm getting the following error:

$ conda env create -n my-custom-env python=3
$ conda activate my-custom-env
$ conda install uv
$ uv init --lib
$ uv sync --python=$(which python)
error: No interpreter found for path `C:/Users/USERNAME/miniforge3/envs/my-custom-env/python` in managed installations, system path, or `py` launcher

This works fine on MacOS by creating a symlink.

$ uv --version
uv 0.4.15
zanieb commented 1 month ago

Can you share verbose output with -v?

Note you can't use --python to sync a project to a different environment. That will just change the interpreter we use to create the environment. Instead, see the documentation on configuring the project environment.

kdheepak commented 1 month ago

Here's the output of --verbose:

$ uv sync --python=$(which python) --verbose
DEBUG uv 0.4.15
DEBUG Found project root: `C:\Users\USERNAME\gitrepos\project-foo`
DEBUG No workspace root found, using project root
DEBUG Checking for Python interpreter at path `C:/Users/USERNAME/miniforge3/envs/my-custom-env/python`
error: No interpreter found for path `C:/Users/USERNAME/miniforge3/envs/my-custom-env/python` in managed installations, system path, or `py` launcher

Note you can't use --python to sync a project to a different environment.

Yes, I was mainly just curious and tried it (on my mac it symlinked python into .venv), and decided to report because it was different on Windows.

zanieb commented 2 weeks ago

Is this still an issue? I wonder if it's because the .exe is missing? It's weird that which would drop that?