Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

uv's Windows launchers in ~/.local/bin are reported as duplicate global Pythons

未关闭
#567 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@karthiknadig 已经在做这个了。

开始于 2026年10月5日。

  • #568 来自 @karthiknadig —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

bug

Problem: On Windows, uv python install creates launcher executables (python.exe, python3.exe, python3.13.exe) in ~/.local/bin, which uv puts on PATH. PET reports each launcher as a separate GlobalPaths environment in addition to the Uv installation they launch, so a single interpreter appears four times in VS Code's environment list and picker.

The launchers are trampolines, not symlinks. When PET spawns one, it reports uv's minor-version junction (%APPDATA%\uv\python\cpython-3.13-windows-x86_64-none) as sys.prefix. Uv::try_from_managed_install only looked at the executable path and returned None for junction prefixes, so the launchers fell through to GlobalPaths.

> pet find --json        (uv's ~/.local/bin on PATH)
Uv           3.13.15          %APPDATA%\uv\python\cpython-3.13.15-windows-x86_64-none\python.exe
GlobalPaths  3.13.15.final.0  %USERPROFILE%\.local\bin\python.exe
GlobalPaths  3.13.15.final.0  %USERPROFILE%\.local\bin\python3.13.exe
GlobalPaths  3.13.15.final.0  %USERPROFILE%\.local\bin\python3.exe

Environment: Windows 11, PET main @ 4ca7c03, uv 0.12.17, CPython 3.13.15 via uv python install 3.13 --default.

Before (VS Code):

Before: one interpreter listed four times

Related: MSYS2 (microsoft/vscode-python-environments#1876) and the python.org Python Install Manager (%LOCALAPPDATA%\Python\bin aliases) are other Windows launchers that PET does not group with the installation they start; Windows find_symlinks is still a stub.

Steps to verify fix:

  1. On Windows, install uv and run uv python install 3.13 --default so python.exe, python3.exe, and python3.13.exe exist in %USERPROFILE%\.local\bin, with that folder on PATH.
  2. Run pet find --json; verify a single environment: kind Uv, %APPDATA%\uv\python\cpython-3.13.x-…\python.exe.
  3. Run pet resolve %USERPROFILE%\.local\bin\python3.13.exe --json; verify it returns that same Uv environment.
  4. In VS Code (with microsoft/vscode-python-environments#1877), verify the interpreter appears once, under Global.
  5. Remove ~/.local/bin from PATH and rerun pet find; verify the Uv environment is still reported.

Found by Copilot

主要语言
Rust
星标
207
派生
45
平均合并
1 天 4 小时
30 天内合并 PR
18

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/python-environment-tools 的其他 Issue

查看 microsoft/python-environment-tools 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。