Skip to content

Instantly share code, notes, and snippets.

@oleksis
Last active March 21, 2023 00:53
Show Gist options
  • Save oleksis/c22ed90daa922c1a072d2593a7f8d5b4 to your computer and use it in GitHub Desktop.
Save oleksis/c22ed90daa922c1a072d2593a7f8d5b4 to your computer and use it in GitHub Desktop.
Python Launcher for Windows

Python Launcher for Windows Installer

➜ winget install -e  --id OleksisFraga.PythonLauncher

➜ get-command py

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     py.exe                                             2.1.0.0    C:\WINDOWS\py.exe$env:PYLAUNCHER_ALWAYS_INSTALL=1

➜ py -V:3.12 --version
Launching winget to install Python. The following output is from the install process
***********************************************************************
...
Iniciando instalación de paquete...
  ██████████████████████████████  100%
Instalado correctamente
***********************************************************************
Install appears to have succeeded. Searching for new matching installs.
Python 3.12.0a4

➜ $env:PYLAUNCHER_ALWAYS_INSTALL=$null

➜ py -3.12 -m venv venv

➜ .\venv\Scripts\Activate.ps1

➜ py -c "import sys; print(sys.version, sys.executable, sep='\n')"
3.12.0a4 (tags/v3.12.0a4:3d5d3f7, Jan 10 2023, 14:12:57) [MSC v.1934 64 bit (AMD64)]
C:\venv\Scripts\python.exe

Notes

Python from Microsoft Store ( "%ProgramFiles%\WindowsApps" to conditionally grant access ) require need a special EXISTS WIN://SYSAPPID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment