install-pyenv-win is a PowerShell script designed to automate the setup, update, and uninstallation of pyenv-win, a popular Python version management tool for Windows. This script simplifies the process of getting pyenv-win up and running, ensuring proper environment variable configuration and handling existing Python installations during updates.
Built by: pyenv-win project, with contributions by Zachary Whiteman & Google Gemini AI.
This script is a standalone PowerShell script for managing your Python development environment.
To run this script, you only need:
- Windows Operating System: (Windows 7 or later).
- PowerShell 5.1 or newer: This script uses PowerShell's built-in capabilities for file system and environment variable management.
- Internet Connection: Required for downloading
pyenv-winfrom GitHub.
- Download: Download the
install-pyenv-win.ps1script file. - Unblock: Right-click the file, go to Properties, and click
Unblockif the file was downloaded from the internet. - Run for Installation: Execute the script from a PowerShell console:
This will install
.\install-pyenv-win.ps1
pyenv-winto$HOME\.pyenvand configure your user-level environment variables. You may need to close and reopen your terminal for changes to take effect. - Run for Uninstallation: To uninstall
pyenv-winand all Python versions managed by it, execute with the-Uninstallswitch:.\install-pyenv-win.ps1 -Uninstall
Simply run the script without any parameters to install pyenv-win. If pyenv-win is already installed, the script will check for the latest version and prompt to update if a newer version is available. It intelligently backs up existing Python installations during this process.
.\install-pyenv-win.ps1To completely remove pyenv-win and all Python versions installed through it, use the -Uninstall parameter.
.\install-pyenv-win.ps1 -UninstallWarning: This action will remove all Python versions managed by pyenv-win.
- Automated Installation: Installs
pyenv-winand sets up necessary environment variables in one go. - Smart Updates: Detects existing
pyenv-wininstallations and updates to the latest version, backing up current Python environments before proceeding. - Complete Uninstallation: Provides a clean removal of
pyenv-winand all associated Python installations. - Environment Variable Configuration: Automatically configures
PATH,PYENV,PYENV_ROOT, andPYENV_HOMEuser-level environment variables. - Robust File Operations: Handles file system creation, moving, and deletion for
pyenv-wincomponents.
The script is developed entirely in PowerShell, utilizing its core capabilities:
- Scripting Language: PowerShell
- Web Requests:
System.Net.WebClientfor downloadingpyenv-winarchives and version information. - Archive Management:
Expand-Archive(viaMicrosoft.PowerShell.Archive) for extracting downloaded files. - File System Management: Standard PowerShell cmdlets like
New-Item,Remove-Item,Move-Item,Test-Path,Get-Contentfor directory and file operations. - Environment Variable Control:
[System.Environment]::SetEnvironmentVariablefor precise control over user-level environment variables.
The install-pyenv-win.ps1 script performs modifications to your user environment and downloads executables from the internet.
- Local System Modification: The script modifies your user-level
PATHenvironment variable and installs files within your user profile directory ($HOME\.pyenv). - External Downloads:
pyenv-winis downloaded from its official GitHub repository. Users should be aware of the source and ensure they trust it. - Uninstallation Warning: The
-Uninstallparameter performs a destructive operation by removing allpyenv-winmanaged Python installations. Exercise caution. - Network Access: Requires an active internet connection to perform installations and updates.
- No Telemetry: The script does not collect or transmit any user data or telemetry.
Distributed under the MIT License. See LICENSE.txt for more information.
Zach Whiteman - elitesoftwarecolimited@gmail.com
HuggingFace - https://huggingface.co/EliteSoftware
HuggingFace (Personal) - https://huggingface.co/TheShadyRainbow
LinkTree - https://linktr.ee/zachrainbow