Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "access is denied" in user folder when running "uv tool install" on Windows 10 #10030

Open
driscollis opened this issue Dec 19, 2024 · 5 comments
Labels
needs-mre Needs more information for reproduction

Comments

@driscollis
Copy link

driscollis commented Dec 19, 2024

I tried the posting app with uv on my Windows 10 machine. The author of posting recommends running the following command:

uv tool install --python 3.12 posting

When I run that in a regular Windows Terminal or a Windows Terminal with admin privileges, I get the following error:

C:\workspace\> uv tool install --python 3.12 posting
Resolved 35 packages in 5.75s
   Built pyperclip==1.9.0
Prepared 34 packages in 4.25s
error: Failed to install: httpx-0.28.1-py3-none-any.whl (httpx==0.28.1)
  Caused by: Failed to persist temporary file to C:\Users\Mike\AppData\Roaming\uv\tools\posting\Lib\site-packages\..\..\Scripts\httpx.exe: Access is denied. (os error 5)

I tried this on two different Windows 10 machines with the same result. I tried running uv cache clean and re-ran the above command with the same result.

I am using uv 0.5.10 (37b11dd 2024-12-17)

@FishAlchemist
Copy link
Contributor

FishAlchemist commented Dec 19, 2024

I seem to have seen this issue before. Can you tell me the output of running the following command on powershell?

Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled'

It's just a command to read the registry, so it doesn't require administrator privileges.

@driscollis
Copy link
Author

Here's what I get:

LongPathsEnabled : 0
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
PSChildName : FileSystem
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry

@FishAlchemist
Copy link
Contributor

FishAlchemist commented Dec 19, 2024

I'm not sure if this issue is triggered by an overly long path. Perhaps you could try enabling long paths.
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#registry-setting-to-enable-long-paths
But if this is truly the issue, I'm not sure if UV has a way to detect it.

Edit:
Even after turning off long paths in my Windows, it still seems to work, so it's probably not the issue.
Perhaps you could also check if the denied-access folder can be accessed normally without granting additional permissions.

@driscollis
Copy link
Author

driscollis commented Dec 19, 2024

I tried enabling long paths, but I still get the same error.

There are no subfolders in C:\Users\Mike\AppData\Roaming\uv\tools so I am guessing uv is cleaning up when it hits that error. That is unfortunate since I can't inspect that folder to see what the permissions are or if I can access it

@samypr100
Copy link
Collaborator

samypr100 commented Dec 21, 2024

Hmmm, I actually would expect uv to install it in C:\Users\Mike\.local\bin\posting.exe which is where it does on my Windows system based on my home path. Was this working for you previously? Edit: I think in your case it even fails to get there.

Could you capture some trace logs?

$Env:RUST_LOG = 'uv=trace'
uv tool uninstall --python 3.12 posting

@samypr100 samypr100 added the needs-mre Needs more information for reproduction label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-mre Needs more information for reproduction
Projects
None yet
Development

No branches or pull requests

3 participants