Skip to content

Latest commit

 

History

History
124 lines (88 loc) · 5.86 KB

File metadata and controls

124 lines (88 loc) · 5.86 KB


💾 About The Project

Screenshot may be slightly outdated. Sorry in advance! :)


install-pyenv-win: Automated pyenv-win Installation and Management

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.

(back to top)

🔰 Getting Started

This script is a standalone PowerShell script for managing your Python development environment.

🕰️ Prerequisites

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-win from GitHub.

💽 Installation & Execution

  1. Download: Download the install-pyenv-win.ps1 script file.
  2. Unblock: Right-click the file, go to Properties, and click Unblock if the file was downloaded from the internet.
  3. Run for Installation: Execute the script from a PowerShell console:
    .\install-pyenv-win.ps1
    This will install pyenv-win to $HOME\.pyenv and configure your user-level environment variables. You may need to close and reopen your terminal for changes to take effect.
  4. Run for Uninstallation: To uninstall pyenv-win and all Python versions managed by it, execute with the -Uninstall switch:
    .\install-pyenv-win.ps1 -Uninstall

(back to top)

🚀 Usage

Installation / Update

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.ps1

Uninstallation

To completely remove pyenv-win and all Python versions installed through it, use the -Uninstall parameter.

.\install-pyenv-win.ps1 -Uninstall

Warning: This action will remove all Python versions managed by pyenv-win.

(back to top)

✨ Key Features

  • Automated Installation: Installs pyenv-win and sets up necessary environment variables in one go.
  • Smart Updates: Detects existing pyenv-win installations and updates to the latest version, backing up current Python environments before proceeding.
  • Complete Uninstallation: Provides a clean removal of pyenv-win and all associated Python installations.
  • Environment Variable Configuration: Automatically configures PATH, PYENV, PYENV_ROOT, and PYENV_HOME user-level environment variables.
  • Robust File Operations: Handles file system creation, moving, and deletion for pyenv-win components.

(back to top)

🛠️ Technology Stack

The script is developed entirely in PowerShell, utilizing its core capabilities:

  • Scripting Language: PowerShell
  • Web Requests: System.Net.WebClient for downloading pyenv-win archives and version information.
  • Archive Management: Expand-Archive (via Microsoft.PowerShell.Archive) for extracting downloaded files.
  • File System Management: Standard PowerShell cmdlets like New-Item, Remove-Item, Move-Item, Test-Path, Get-Content for directory and file operations.
  • Environment Variable Control: [System.Environment]::SetEnvironmentVariable for precise control over user-level environment variables.

(back to top)

📐 Architecture & Security Notes

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 PATH environment variable and installs files within your user profile directory ($HOME\.pyenv).
  • External Downloads: pyenv-win is downloaded from its official GitHub repository. Users should be aware of the source and ensure they trust it.
  • Uninstallation Warning: The -Uninstall parameter performs a destructive operation by removing all pyenv-win managed 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.

(back to top)

🪪 License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

☎️ Contact

Zach Whiteman - elitesoftwarecolimited@gmail.com

HuggingFace - https://huggingface.co/EliteSoftware

HuggingFace (Personal) - https://huggingface.co/TheShadyRainbow

LinkTree - https://linktr.ee/zachrainbow

Patreon - https://www.patreon.com/c/EliteSoftwareCo

(back to top)