uv: Installing into a virtualenv on Windows fails when the location changes
Hi there!
uv is awesome, but we’re running into an issue with installing into a virtualenv on Windows. If I run
uv pip install --python=/path/to/python
I sometimes get an error message similar to the following:
RuntimeError: Unable to run the following command:
uv pip install --python=C:\Users\RUNNER~1\AppData\Local\Temp\tmp3hg_0oka\.edgetest\core\Scripts\python .[tests]
WARNING venv:__init__.py:165 Actual environment location may have moved due to redirects, links or junctions.
Requested location: "C:\Users\RUNNER~1\AppData\Local\Temp\tmp3hg_0oka\.edgetest\lower_env\Scripts\python.exe"
Actual location: "C:\Users\runneradmin\AppData\Local\Temp\tmp3hg_0oka\.edgetest\lower_env\Scripts\python.exe"
this is running on GitHub Actions using windows-latest and uv version 0.2.28. If curious, the error log is in the job from this PR. Any help is greatly appreciated!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (10 by maintainers)
Commits related to this issue
- Infer missing `.exe` in Windows Python discovery (#5456) ## Summary Closes https://github.com/astral-sh/uv/issues/5445. — committed to astral-sh/uv by charliermarsh 2 years ago
Yep, I’ll push up a change and see if that fixes the issue
That may not matter here though. One sec.
Thanks for the quick reply! I updated the logging and got this output:
Just to note – our current code uses
pipwith commands equivalent tosince I haven’t changed the logic for finding the virtual environment