PBS Installer

2026.3.25 · active · verified Sat Mar 28

pbs-installer is a Python library that serves as an installer for @indygreg's python-build-standalone. It automates the process of downloading and installing specific Python versions in a standalone fashion. The library is actively maintained with frequent releases, often multiple times a month, and is currently at version 2026.3.25.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the `install` function from `pbs_installer` to download and install a specific version of CPython into a local directory. It highlights the main entry point for programmatic usage.

import os
from pbs_installer import install

# Define the target directory for Python installation
install_path = os.path.join(os.getcwd(), "my_python_env")
python_version = "3.10" # Example: install CPython 3.10

print(f"Attempting to install CPython {python_version} to {install_path}")
try:
    # Ensure optional dependencies are installed for full functionality, e.g., via `pip install pbs-installer[all]`
    install(request=python_version, destination=install_path)
    print(f"CPython {python_version} installed successfully to {install_path}")
except Exception as e:
    print(f"Error installing Python: {e}")

# Example of how to verify installation (simplified)
# This would typically involve checking for the python executable in install_path
python_executable = os.path.join(install_path, 'bin', 'python') if os.name == 'posix' else os.path.join(install_path, 'python.exe')
if os.path.exists(python_executable):
    print(f"Python executable found at: {python_executable}")
else:
    print(f"Python executable NOT found at: {python_executable}")

view raw JSON →