Improve Python detection on windows to support virtualenv activated #12053
Labels
enhancement
New feature or request
python-setup
Issues with Python's environment and setup
quarto-check
Related to `quarto check`
windows
Milestone
Currently on Windows, Quarto detection relies on
QUARTO_PYTHON
being setpy.exe
launcher being available (with optionallyPY_PYTHON
being set)conda
being usedHowever, in situation where
pyenv
is used to manage python install, or evenuv
nowadays, it creates problem. All the more because virtual env is not even taken into account at this step of detectionquarto-cli/src/command/check/check.ts
Lines 335 to 337 in ca05876
uv has some python installed
Let's initialize a project with Python 3.13.1
Now the version of python for the project is the one from the venv
But Quarto find none
Activating virtualenv puts the python binary on PATH
But still quarto can't find it
This is because
VIRTUAL_ENV
env var is not check at detection step but later for kernel spec informationpython.exe
on PATH and notpython3.exe
and dectection code does not account for that.If
py.exe
was available then it would work.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
The text was updated successfully, but these errors were encountered: