uv: uv self update: failed to execute installer (status: exit code: 1) on Windows
When running uv self update --verbose on my Windows 11 machine, I get the following output:
DEBUG uv 0.2.28
info: Checking for updates...
error: failed to execute installer (status: exit code: 1)
Installing and updating uv through the following command works as expected: irm https://astral.sh/uv/install.ps1 | iex
uv has only been installed via the standalone installer, not via pip.
I can’t seem to reproduce the issue on any other system or virtual machine.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 19 (10 by maintainers)
I agree it would be great to just run in the current version of powershell, core on not. Unfortunately, explicitly invoking powershell here is a workaround for the reverse problem: people would paste this command into cmd and it would fail. And microsoft quite explicitly made classic powershell and powershell core have different commands (
powershellvspwsh) to make sure you don’t accidentally invoke one when you meant the other, since they have fairly different semantics (especially around utf8 vs utf16).I’m pretty confident the cmd case is more pervasive than the pwsh one, but still, it would be good for us to find a way to manage this execution policy thing better.
Yes, the issue persists. Also tried different older versions of uv and deleted everything uv-related from the AppData directory.
I also tried changing the
ExecutionPolicyfromRemoteSignedtoUnrestricted, but that didn’t help either.I’ve hit this too. I have a pretty default Windows 11, with PowerShell core, but with dev mode disabled:
The alternative ways of installing on Windows should at least be documented:
It might be worth mentioning that under
cmdone should use thepowershell -cvariant, and theirm ...variant forpowershell.Windows also ships with
curlnow, so a variation of this would work under bothcmdandpowershell. The.batfile would autodetect the env it’s run under and proceed accordingly:@jon-ton would you be willing to contribute that to the installation docs?
Trying to update
uvv0.2.36viauv self update --verboserevealed some information which helped me fix the problem.My
Execution-Policyis set toRemoteSigned. Theuvstandalone installer also works, so what’s going on here?Get-ExecutionPolicy -ListIt turnes out that the current
PowerShell Core (v7)and the integratedPowerShell Classic (v5)have separateExecution-Policysettings and for some reason the integrateduvupdater runs inPowerShell Classic!powershell.exe Get-ExecutionPolicy -ListChanging the
Execution-PolicytoRemoteSignedinPowerShell Classictoo fixes my issues! 😄I think the updater should run in the same shell as the
uvcommand is run from to prevent these kind of issues.