Skip to content

Commit a7fdc60

Browse files
marco-ippolitotargos
authored andcommitted
tools: add find pyenv path on windows
PR-URL: #54314 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 87ca1d7 commit a7fdc60

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/msvs/find_python.cmd

+7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ for %%k in ( "HKCU\Software", "HKLM\SOFTWARE", "HKLM\Software\Wow6432Node") do (
1717
if not errorlevel 1 goto :found-python
1818
)
1919

20+
:: Check for pyenv-win installation using pyenv which python
21+
for /f "tokens=*" %%i in ('pyenv which python 2^>nul') do set p=%%i
22+
if defined p (
23+
for /f "tokens=*" %%j in ('"%p%" --version') do set python_version=%%j
24+
goto :found-python
25+
)
26+
2027
goto :no-python
2128

2229

0 commit comments

Comments
 (0)