-
Notifications
You must be signed in to change notification settings - Fork 390
Description
Currently on Windows, Quarto detection relies on
QUARTO_PYTHONbeing set- The
py.exelauncher being available (with optionallyPY_PYTHONbeing set) condabeing used
However, in situation where pyenv is used to manage python install, or even uv nowadays, it creates problem. All the more because virtual env is not even taken into account at this step of detection
quarto-cli/src/command/check/check.ts
Lines 335 to 337 in ca05876
| caps = await jupyterCapabilities(); | |
| }); | |
| if (caps) { |
cd $env:TEMP
mkdir quarto
cd quarto
uv has some python installed
❯ uv python find
C:\Users\chris\AppData\Roaming\uv\python\cpython-3.13.1-windows-x86_64-none\python.exe
Let's initialize a project with Python 3.13.1
uv init --python 3.13.1
uv add jupyter
Now the version of python for the project is the one from the venv
❯ uv python find
C:\Users\chris\AppData\Local\Temp\quarto\.venv\Scripts\python.exe
But Quarto find none
❯ uv run quarto check jupyter
Quarto 1.7.13
[>] Checking Python 3 installation....(None)
Unable to locate an installed version of Python 3.
Install Python 3 from https://www.python.org/downloads/
Activating virtualenv puts the python binary on PATH
❯ .\.venv\Scripts\activate
❯ (gcm python).Source
C:\Users\chris\AppData\Local\Temp\quarto\.venv/Scripts\python.exe
But still quarto can't find it
❯ quarto check jupyter
Quarto 99.9.9
[>] Checking Python 3 installation....(None)
Unable to locate an installed version of Python 3.
Install Python 3 from https://www.python.org/downloads/
This is because
VIRTUAL_ENVenv var is not check at detection step but later for kernel spec information- windows has
python.exeon PATH and notpython3.exeand dectection code does not account for that.
If py.exe was available then it would work.
❯ cd C:\Users\chris\AppData\Local\Temp\quarto
❯ py -0
No installed Pythons found!
❯ .\.venv\Scripts\activate
❯ py -0
* Active venv
❯ quarto check jupyter
Quarto 99.9.9
[>] Checking Python 3 installation....OK
Version: 3.13.1
Path: C:/Users/chris/AppData/Local/Temp/quarto/.venv/Scripts/python.exe
Jupyter: 5.7.2
Kernels: python3, julia-1.11
[>] Checking Jupyter engine render....OK
So current situation on windows does rely too much on py.exe which is only available for user using Windows Store Python version, or installing from the Python official website.
Related to