Skip to content

Commit ecf1137

Browse files
committed
tentative fix for finding Python on Windows
1 parent fe36bce commit ecf1137

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libs/python/detect.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ func DetectExecutable(ctx context.Context) (string, error) {
2626
//
2727
// See https://github.com/pyenv/pyenv#understanding-python-version-selection
2828
out, err := exec.LookPath("python3")
29+
30+
// On Windows with uv, the venv/Scripts directory contains python.exe but not python3.exe nor python3
31+
if runtime.GOOS == "windows" && err != nil && errors.Is(err, exec.ErrNotFound) {
32+
out, err = exec.LookPath("python.exe")
33+
}
34+
2935
// most of the OS'es have python3 in $PATH, but for those which don't,
3036
// we perform the latest version lookup
3137
if err != nil && !errors.Is(err, exec.ErrNotFound) {

0 commit comments

Comments
 (0)