Skip to content

Commit

Permalink
tools: add find pyenv path on windows
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
marco-ippolito authored and targos committed Aug 14, 2024
1 parent 0d716ad commit b659fc0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/msvs/find_python.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ for %%k in ( "HKCU\Software", "HKLM\SOFTWARE", "HKLM\Software\Wow6432Node") do (
if not errorlevel 1 goto :found-python
)

:: Check for pyenv-win installation using pyenv which python
for /f "tokens=*" %%i in ('pyenv which python 2^>nul') do set p=%%i
if defined p (
for /f "tokens=*" %%j in ('"%p%" --version') do set python_version=%%j
goto :found-python
)

goto :no-python


Expand Down

0 comments on commit b659fc0

Please sign in to comment.