Fix uv sync failure on Windows (symlink privilege) - #126
Open
niutonsilva338-debug wants to merge 1 commit into
Open
Fix uv sync failure on Windows (symlink privilege)#126niutonsilva338-debug wants to merge 1 commit into
niutonsilva338-debug wants to merge 1 commit into
Conversation
uv sync fails on Windows with 'Missing expected target directory for Python minor version link' when Developer Mode / admin privileges are unavailable to create the minor-version symlink (e.g. cpython-3.12 -> cpython-3.12.13). Pinning a concrete patch version sidesteps the symlink step entirely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pin
.python-versionto a concrete patch version (3.12.13) instead of relying on uv's minor-version alias.Why
On Windows,
uv sync(anduv python install) fails with:This happens because uv creates the
cpython-3.12-...->cpython-3.12.13-...alias as a filesystem symlink, which requires Windows Developer Mode or
admin/elevated privileges (
SeCreateSymbolicLinkPrivilege). Without either,the concrete Python interpreter still downloads and installs correctly, but
the alias step fails and aborts
uv sync.Pinning
.python-versionto the concrete patch version sidesteps theminor-version symlink entirely, so
uv syncsucceeds out of the box on adefault (non-Developer-Mode) Windows machine.
Testing
Reproduced the failure and verified the fix on a fresh Windows 11 install
with
uv 0.12.2.Summary by cubic
Pins
.python-versionto Python 3.12.13 souvskips the minor-version alias symlink on Windows. This fixesuv syncfailures on machines without Developer Mode or admin rights..python-versionto3.12.13to bypass thecpython-3.12→cpython-3.12.13symlink.uv syncanduv python installto run on Windows without elevated privileges.Written for commit 60bb435. Summary will update on new commits.