-
Notifications
You must be signed in to change notification settings - Fork 790
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
uv venv: support Pythons installed via the Microsoft Store #2105
Comments
Thanks! |
Probably related:
PS C:\Users\username> # try `uv venv`
PS C:\Users\username> uv venv --verbose --python 3.11
uv_interpreter::python_query::find_requested_python request=3.11
0.002206s 0ms DEBUG uv_interpreter::python_query Starting interpreter discovery for Python @ `3.11`
× failed to canonicalize path `C:\Users\username\AppData\Local\Microsoft\WindowsApps\python3.11.exe`
╰─▶ The file cannot be accessed by the system. (os error 1920)
PS C:\Users\username> # execute python directly
PS C:\Users\username> C:\Users\username\AppData\Local\Microsoft\WindowsApps\python3.11.exe
Python 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'C:\\Users\\username\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe'
>>> |
Yeah I'm working on this now. Should work soon. |
## Summary After #2121, the only remaining issue is that calling `canonicalize` on these Pythons returns an error. Closes #2105. ## Test Plan Uninstalled all python.org Pythons on my Windows machine, then created a virtualenv. The resulting config file: ``` Using Python 3.11.8 interpreter at: C:\Users\crmar\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe Creating virtualenv at: .venv Activate with: .venv\Scripts\activate PS C:\Users\crmar\workspace\puffin> cat .\.venv\pyvenv.cfg home = C:\Users\crmar\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0 implementation = CPython version_info = 3.11.8 include-system-site-packages = false uv = 0.1.13 prompt = puffin ``` Prior to this PR, it would fail with a canonicalization error. Prior to #2121, it would leave a "bad" Python in the config file: ``` Using Python 3.11.8 interpreter at: C:\Users\crmar\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe Creating virtualenv at: .venv Activate with: .venv\Scripts\activate PS C:\Users\crmar\workspace\puffin> cat .\.venv\pyvenv.cfg home = C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0 implementation = CPython version_info = 3.11.8 include-system-site-packages = false uv = 0.1.13 prompt = puffin ``` Which, once activated, would fail with: ``` (venv) PS C:\Users\crmar\workspace\puffin> python No Python at '"C:\Users\crmar\AppData\Local\Programs\Python\Python312\python.exe' ```
I'm not sure this is fixed?
|
It works without issue on my Windows Store installation. Do you mind sharing the outputs of |
|
If I push to a branch, would you be able to test locally by running |
Creating a new issue for this specific fix (#2208), which I'm working on now. |
uv venv
currently (v0.1.13) fails to create venvs with Pythons installed via the Microsoft Store (Windows 11 Version 10.0.22631 Build 22631). Example with Python 3.12:The text was updated successfully, but these errors were encountered: