Skip to content

About

This Program will install a list of useful python libraries on windows device.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Python-Tool

Python Latest Installer & Sandbox Toolkit for Windows

Synopsis

A zero-dependency installer and updater for the latest stable Python 3 release on Windows, paired with an optional PEP 621 pyproject.toml package bundle for Windows Sandbox analysis, networking, and development.

The installer ships in two feature-parity flavors so you can pick your preferred workflow:

  • install_python.bat — A self-contained Batch + PowerShell polyglot. Double-click friendly, bypasses ExecutionPolicy prompts automatically, and updates the active cmd.exe session's PATH.
  • Install-Python.ps1 — A standalone Windows PowerShell 5.1 / PowerShell 7+ script cmdlet with native [CmdletBinding()] parameter validation, tab completion, Get-Help integration, and direct $env:Path updates.
  • pyproject.toml — Optional modular toolkit bundle using PEP 621 [project.optional-dependencies] extras (core, reversing, net, windows, data, ai, dev, all) for broad pip and uv compatibility.

Installer Features

  • Always-current & verifiable: Queries python.org/ftp/python/ (falling back to the Windows downloads page) and probes the actual installer URL via HEAD so source-only / security-only releases are skipped automatically.
  • Signature verified: Checks the Authenticode certificate of the downloaded installer and requires a Python Software Foundation signer before executing.
  • Per-user by default (no admin needed): Installs quietly into %LOCALAPPDATA%\Programs\Python\Python3XX with pip and the py launcher scoped to the current user (InstallLauncherAllUsers=0).
  • Optional all-users mode: Installs system-wide to %ProgramFiles% and Machine PATH. Automatically prompts for UAC elevation when run interactively, or fails fast with exit code 5 in non-interactive/automation contexts.
  • Optional stable Python3 junction: Maintains a fixed-path directory junction (Python3 -> Python3XX) so downstream scripts and tooling don't break on minor version upgrades. Refuses to overwrite an existing real directory.
  • Non-destructive PATH handling:
    • Writes REG_EXPAND_SZ directly to the registry and broadcasts WM_SETTINGCHANGE.
    • Prunes only stale managed Python3* entries and deduplicates case-insensitively without rewriting or deleting unrelated PATH entries.
    • Saves a timestamped backup before modifying the registry (%LOCALAPPDATA%\PythonInstaller for user scope; %ProgramData%\PythonInstaller for machine scope in Install-Python.ps1).
    • Warns above 2,047 characters (legacy Win32 dialog limit) and aborts the PATH write cleanly with exit code 2 if the combined expanded PATH would exceed 32,000 characters.
  • Architecture & OS aware: Detects native amd64, arm64, and x86 (including under WoW64), supports explicit architecture overrides, blocks unsupported environments (Windows RT / 32-bit ARM, S Mode, pre-Windows 10 unless pinned to <= 3.8), and works cleanly on Windows Sandbox and Windows 10/11 LTSC.
  • Post-install verification: Confirms python -V, pip (running ensurepip if missing), and the py -3 launcher.

Quick Start Guide

Using install_python.bat (CMD / Double-Click)

Double-click install_python.bat for an interactive per-user install, or run from cmd.exe:

REM Install or upgrade to the newest Python 3 for the current user
install_python.bat

REM Pin to the latest 3.13.x release, system-wide, unattended
install_python.bat 3.13 /allusers /unattended

REM Install 32-bit Python without creating the stable Python3 junction
install_python.bat /arch=x86 /nojunction

(Both /flag and --flag syntax are accepted by install_python.bat, including hyphenated forms like --all-users and --no-junction.)

Using Install-Python.ps1 (Windows PowerShell 5.1 / pwsh 7+)

# Install or upgrade to the newest Python 3 for the current user
.\Install-Python.ps1

# Pin to the latest 3.13.x release, system-wide, unattended
.\Install-Python.ps1 3.13 -AllUsers -Unattended

# Install 32-bit Python without creating the stable Python3 junction
.\Install-Python.ps1 -Arch x86 -NoJunction

# View built-in documentation
Get-Help .\Install-Python.ps1 -Full

If your machine's ExecutionPolicy blocks downloaded scripts, either unblock the file once (Unblock-File .\Install-Python.ps1) or invoke with bypass:

powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-Python.ps1 -Unattended

Installer Options & Flags

install_python.bat Install-Python.ps1 Aliases (.ps1) Description
3.XX or /series=3.XX 3.XX or -Series 3.XX — Pin installation to the newest release of a specific minor series (e.g. 3.13).
/allusers -AllUsers -Machine Install system-wide to Program Files and Machine PATH (requests UAC if interactive).
/junction -Junction -StablePath Create or refresh the fixed-path Python3 directory junction pointing to the active install.
/nojunction -NoJunction -NoStablePath Skip creating or updating the fixed-path Python3 junction.
/unattended or -y -Unattended -Quiet, -Silent, -y Non-interactive mode; skips prompts and final pause. Uses the default junction setting unless overridden.
/arch=NAME -Arch NAME — Target architecture override: amd64 (x64), arm64, or x86 (win32). Defaults to native OS architecture.
SET NOPAUSE=1 -NoPause — Skip the final pause in interactive mode. Both scripts honor the NOPAUSE=1 environment variable.
/? or --help Get-Help .\Install-Python.ps1 — Display usage and option details.

Sandbox Toolkit (pyproject.toml)

Once Python is installed, you can pull any combination of curated analysis, networking, and dev libraries from the included PEP 621 pyproject.toml. Using [project.optional-dependencies] resolves the full dependency graph in a single pass and works across pip (including older post-PEP 517 versions) and uv.

Available Extras

Extra Included Libraries
core requests, beautifulsoup4, lxml, html5lib, pyyaml, python-dateutil, packaging, toml, psutil, rich, colorama, click, tqdm, tabulate
reversing pefile, lief, yara-python, volatility3, cryptography, pycryptodome, bcrypt, zxcvbn
net scapy, dnspython, ifaddr, pyshark
windows pywin32, pywin32-ctypes, comtypes, WMI, pyttsx3
data numpy, pandas, matplotlib, openpyxl, xlsxwriter, ipython, jupyterlab, notebook, prompt-toolkit
ai openai, nltk, transformers
dev ruff, pyright, mypy
all Installs every extra listed above (requires pip >= 21.2 or uv).

Installing Extras

⚠️ Always quote ".[...]" in PowerShell so [ and ] aren't interpreted as wildcard globs

⚠️Prefer prebuilt wheels to avoid needing MSVC Build Tools in Sandbox

Using pip:

py -3 -m pip install --prefer-binary ".[core,reversing]"
py -3 -m pip install --prefer-binary ".[all]"

Using uv:

uv pip install --system ".[core,reversing]"
uv pip install --system ".[all]"

Notes

  • NLTK corpora (if using ai): Download the current corpus packages after installing:
    py -3 -c "import nltk; [nltk.download(c) for c in ('punkt_tab', 'stopwords', 'wordnet', 'omw-1.4', 'averaged_perceptron_tagger_eng')]"
  • External binaries: scapy requires Npcap and pyshark requires tshark (Wireshark) on Windows for live packet capture. transformers requires a deep learning backend (such as torch) to execute models.
  • New Python minor releases: yara-python can occasionally lag on prebuilt wheels for brand-new Python minor versions; pin an earlier series (e.g. 3.13) if needed.
  • Legacy requirements.txt: If an environment specifically requires a flat requirements file, generate one on demand from pyproject.toml via uv pip compile or uv export rather than maintaining a duplicate list.

Install Locations

Scope Base Directory Versioned Install Stable Junction
Current User (default) %LOCALAPPDATA%\Programs\Python ...\Python3XX ...\Python3
All Users (amd64 / arm64) %ProgramFiles% ...\Python3XX ...\Python3
All Users (x86 on 64-bit OS) %ProgramFiles(x86)% ...\Python3XX ...\Python3

When the stable junction is enabled and active, PATH points to ...\Python3 and ...\Python3\Scripts so your PATH remains static across minor Python upgrades.

Exit Codes

Code Meaning
0 Success (installed, upgraded, or already up to date).
2 Completed with warnings — Python is installed and verified, but persistent PATH was not updated (e.g. length ceiling reached or registry key unavailable).
5 Elevation required — All-users install requested in a non-interactive session without Administrator privileges.
1 (or MSI/EXE code) Fatal error during validation, download, signature check, installation, or verification.

Requirements & Compatibility

  • OS: Windows 10 (build 1809+ recommended) or Windows 11, including LTSC and Windows Sandbox. Older Windows versions require pinning an older series (e.g. 3.8).
  • Runtime: Built-in Windows PowerShell 5.1 (or PowerShell 7+). No external modules or package managers required.
  • Unsupported: Windows RT (32-bit ARMv7), Windows S Mode, and Windows 11 SE (locked-down Store-only editions).

About

This Program will install a list of useful python libraries on windows device.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages