Skip to content

Instantly share code, notes, and snippets.

@BoQsc
Last active July 21, 2024 07:27
Show Gist options
  • Save BoQsc/475e9cf16d5686e93c7a0099c5e87bc4 to your computer and use it in GitHub Desktop.
Save BoQsc/475e9cf16d5686e93c7a0099c5e87bc4 to your computer and use it in GitHub Desktop.
How to find the python executable on Windows.
@ECHO OFF
python -c "import sys; print(sys.executable)"
PAUSE
@ECHO OFF
FOR /F "delims=" %%I IN ('python -c "import sys; print(sys.executable)"') DO SET PYTHON_PATH=%%I
ECHO Python executable path is: %PYTHON_PATH%
PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment