This guide covers Python installation on Windows using the official Python embeddable package.
- Windows 10/11 (Windows 7/8 may work but are untested)
- PowerShell 5.1 or later (included with Windows 10+)
- Internet access
- ~100 MB free disk space
# Run the bootstrap script
.\bootstrap-windows.ps1
# For a fresh reinstall
.\bootstrap-windows.ps1 -ForceDefault: %USERPROFILE%\.python-nonadmin
This typically resolves to:
C:\Users\YourUsername\.python-nonadmin
.python-nonadmin/
├── python.exe # Main Python interpreter
├── pythonw.exe # GUI Python (no console)
├── python312.dll # Python DLL
├── python312._pth # Path configuration
├── python312.zip # Standard library (compressed)
├── Lib/ # Additional libraries
│ └── site-packages/ # Installed packages
├── Scripts/ # pip, executables
│ ├── pip.exe
│ └── ...
└── DLLs/ # Extension modules
If you see an execution policy error:
# Check current policy
Get-ExecutionPolicy
# Set to allow local scripts (user-level, no admin needed)
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedFor corporate environments with proxy servers:
# Set before running bootstrap
$env:HTTP_PROXY = "http://proxy.company.com:8080"
$env:HTTPS_PROXY = "http://proxy.company.com:8080"
# Then run
.\bootstrap-windows.ps1To make pip respect the proxy permanently:
pip config set global.proxy http://proxy.company.com:8080Some antivirus software may block downloads or quarantine Python files:
-
Windows Defender: Usually allows Python. If blocked, add an exclusion for the install directory.
-
Corporate Antivirus: May require IT whitelisting. As an alternative:
- Manually download the embeddable package from python.org
- Place it in the expected location
- Run the script with
-SkipDownload(if available)
The bootstrap script adds two directories to your user PATH:
%USERPROFILE%\.python-nonadmin(for python.exe)%USERPROFILE%\.python-nonadmin\Scripts(for pip and installed scripts)
This does not require administrator access as it modifies only user-level environment variables.
If you have a system Python installed, the user-level PATH takes precedence in new terminals. To use system Python:
# Check which python is active
where.exe python
# Full path to system Python (example)
C:\Python312\python.exe
# Full path to user Python
%USERPROFILE%\.python-nonadmin\python.exeRestart your terminal. If still failing:
# Check if PATH was updated
$env:PATH -split ';' | Select-String "python-nonadmin"
# Manually add for current session
$env:PATH = "$env:USERPROFILE\.python-nonadmin;$env:USERPROFILE\.python-nonadmin\Scripts;$env:PATH"This often indicates proxy issues or certificate problems:
# Try with trusted host flags
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org package-nameThe ._pth file wasn't properly configured. Edit it manually:
$pth = "$env:USERPROFILE\.python-nonadmin\python312._pth"
(Get-Content $pth) -replace '#import site', 'import site' | Set-Content $pth# Remove installation directory
Remove-Item -Recurse -Force "$env:USERPROFILE\.python-nonadmin"
# Clean user PATH (manual step)
# Open: System Properties > Environment Variables > User variables
# Edit PATH and remove the python-nonadmin entries