-
Notifications
You must be signed in to change notification settings - Fork 900
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
Access denied for uv pip sync
on Windows
#1368
Comments
Thank you for reporting. This is related to #1327 |
Ah, I looked for something similar but missed it. Thanks! |
I think deleting executable is not allowed when it's running, but it can rename itself. |
Just completing, the issue also happens with |
I would strongly recommend against managing uv as a Python package and use our installer and |
@zanieb We have issues on windows with the path and installing uv globally is not always possible. You cannot run |
Not a solution, but a workaround (and note I use When I tried updating uv (or pip/setuptools) within the environment, that didn't help. I know this won't help all users, but maybe the handful who stumble in here searching for the |
Yeah, in general you can "solve" this by installing uv outside of whatever environment you're trying to manage. uv doesn't need to be in a given virtual environment in order to operate on it (it's just a Rust binary, it can run over any environment or Python interpreter on your system). (Of course I'd prefer not to error here though.) |
That is not easy without the right permissions unless I download the binary and run it locally. It makes managing UV version way more difficult IMO. In the end I resort to This is one of the 4 open tickets here preventing me from fully adopting uv. It is very close, but I still rely on several workarounds and other compromises with pip. Would it be possible to check if the file you're going to write exists and then save a temp one then perform a rename operation?
This operation would be atomic without first removing the original file which the Windows forbids. If that does not work, the solution would be somewhere in the lines of running UV from a temp executable. |
Does #5455 solve your need? you can set |
## Summary On Windows, we can't delete the currently-running executable -- at least, not trivially. But the [`self_replace`](https://docs.rs/self-replace/latest/self_replace/) crate can help us here. Closes #1368. Closes #4980. ## Test Plan On my Windows machine: - `maturin build` - `python -m venv .venv` - `.venv/Scripts/activate` - `pip install /path/to/uv.whl` - `uv pip install /path/to/uv.whl` - `uv pip uninstall uv`
Just wanted to mention that manually deleting the |
I'm betting using
|
Should also be fixed in newer releases. |
Out of curiosity, what is the fix for this issue? FYI, these may help: poetry Issue #1031 |
We use a library called |
Doy, just saw #8914. Sorry, my bad. And thank you! |
Hey All, I've been testing out uv for my work and am hitting what seems a related issue to this one. Running on a windows 11 machine I'm generating some base python environments and I hit this same error (os error 5) when running
running this one time it fails. Running it a second time it succeeds.
|
Thanks I'll go there |
Within a given venv, running
uv pip sync <requirement file>
fails with Access is denied. This is on Windows.The text was updated successfully, but these errors were encountered: