Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

feat(windows): allow detecting Python executable#276

Merged
mfuntowicz merged 1 commit into
mainfrom
windows-python-detection
Oct 23, 2025
Merged

feat(windows): allow detecting Python executable#276
mfuntowicz merged 1 commit into
mainfrom
windows-python-detection

Conversation

@mfuntowicz
Copy link
Copy Markdown
Member

This PR allows Windows building script to pick up the current Python executable - useful if using a virtualenv for instance.

Copy link
Copy Markdown
Contributor

@MekkCyber MekkCyber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +338 to +342

# Verify Python and PyTorch version
$torchVersion = & $pythonExe -c "import torch; print(torch.__version__)" 2>$null
if ($torchVersion) {
Write-Status "Detected PyTorch version: $torchVersion" -Type Info
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny nit: the code only checks the PyTorch version, not Python, as the comment currently suggests.

Copy link
Copy Markdown
Member Author

@mfuntowicz mfuntowicz Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does detect Python just above:

$pythonExe = (Get-Command python -ErrorAction SilentlyContinue).Source

and then reuse the Python executable to extract information about PyTorch within the detected python context 😊

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I thought you wanted to print the Python version too in that command! Looks good to me

@mfuntowicz mfuntowicz merged commit 889428e into main Oct 23, 2025
28 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants