Skip to content

Commit ef8f572

Browse files
Copilotbytemain
andauthored
Handle missing Windows uv-build python explicitly
Agent-Logs-Url: https://github.com/version-fox/vfox-python/sessions/07e4e50a-f299-4a36-a8b8-405f0222677a Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent e7782fd commit ef8f572

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/util.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,10 @@ local function ensureWindowsUvBuildPip(path)
581581
end
582582

583583
local pythonExe = path .. "\\python.exe"
584-
if not pathExists(pythonExe) or pathExists(path .. "\\Scripts\\pip.exe") then
584+
if not pathExists(pythonExe) then
585+
error("Cannot install pip: python.exe was not found at " .. pythonExe)
586+
end
587+
if pathExists(path .. "\\Scripts\\pip.exe") then
585588
return
586589
end
587590

@@ -594,7 +597,7 @@ local function ensureWindowsUvBuildPip(path)
594597
local command = string.format("%s -E -s -m ensurepip -U --default-pip", shellQuote(pythonExe))
595598
local exitCode = os.execute(command)
596599
if not commandSucceeded(exitCode) then
597-
error("ensurepip failed while installing pip. exit " .. tostring(exitCode))
600+
error("ensurepip failed while installing pip. Exit code: " .. tostring(exitCode))
598601
end
599602

600603
if pathExists(path .. "\\Scripts\\pip.exe") then
@@ -606,7 +609,7 @@ local function ensureWindowsUvBuildPip(path)
606609
shellQuote(pythonExe), quotedBundledPath)
607610
exitCode = os.execute(command)
608611
if not commandSucceeded(exitCode) then
609-
error("pip force-reinstall failed while creating pip scripts. exit " .. tostring(exitCode))
612+
error("pip force-reinstall failed while creating pip scripts. Exit code: " .. tostring(exitCode))
610613
end
611614

612615
if not pathExists(path .. "\\Scripts\\pip.exe") then

0 commit comments

Comments
 (0)