{"id":552,"library":"pbs-installer","title":"PBS Installer","description":"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.","status":"active","version":"2026.3.25","language":"python","source_language":"en","source_url":"https://github.com/frostming/pbs-installer","tags":["installer","build","standalone","python-versions","packaging"],"install":[{"cmd":"pip install pbs-installer","lang":"bash","label":"Basic Installation"},{"cmd":"pip install pbs-installer[all]","lang":"bash","label":"Installation with all optional dependencies (recommended)"},{"cmd":"pipx install pbs-installer","lang":"bash","label":"CLI Installation (recommended for CLI usage)"}],"dependencies":[{"reason":"Required for downloading Python build files from URLs. Part of the `[download]` extra.","package":"httpx","optional":true},{"reason":"Required for extracting Python build files compressed with Zstandard. Part of the `[install]` extra.","package":"zstandard","optional":true},{"reason":"Requires Python 3.8 or newer to run the installer itself.","package":"python","optional":false}],"imports":[{"symbol":"install","correct":"from pbs_installer import install"},{"note":"The `download` function is often used internally by `install`, but can be called directly.","symbol":"download","correct":"from pbs_installer import download"}],"quickstart":{"code":"import os\nfrom pbs_installer import install\n\n# Define the target directory for Python installation\ninstall_path = os.path.join(os.getcwd(), \"my_python_env\")\npython_version = \"3.10\" # Example: install CPython 3.10\n\nprint(f\"Attempting to install CPython {python_version} to {install_path}\")\ntry:\n    # Ensure optional dependencies are installed for full functionality, e.g., via `pip install pbs-installer[all]`\n    install(request=python_version, destination=install_path)\n    print(f\"CPython {python_version} installed successfully to {install_path}\")\nexcept Exception as e:\n    print(f\"Error installing Python: {e}\")\n\n# Example of how to verify installation (simplified)\n# This would typically involve checking for the python executable in install_path\npython_executable = os.path.join(install_path, 'bin', 'python') if os.name == 'posix' else os.path.join(install_path, 'python.exe')\nif os.path.exists(python_executable):\n    print(f\"Python executable found at: {python_executable}\")\nelse:\n    print(f\"Python executable NOT found at: {python_executable}\")","lang":"python","description":"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."},"warnings":[{"fix":"Install `pbs-installer` with the `[all]` extra: `pip install pbs-installer[all]`.","message":"Full functionality requires optional dependencies `httpx` and `zstandard`. Without them, downloading might fail (e.g., `ModuleNotFoundError` for `httpx`) or Zstandard-compressed builds cannot be extracted.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify your imports: `from pbs_installer import install` and confirm `pypi.org/project/pbs-installer` is the intended library.","message":"There are multiple unrelated Python libraries or projects with 'PBS' in their name (e.g., `pbs-python` for Torque/OpenPBS, `pbs` for subprocess management). Ensure you are importing and using `pbs_installer` from `frostming` for Python Build Standalone installations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the `pbs-installer` documentation or source code for supported version string formats. Use precise version numbers.","message":"The `request` parameter for the `install` function expects specific Python version strings (e.g., '3.10', '3.10.4', 'pypy-3.9'). Passing malformed or ambiguous strings might result in a `ValueError` if a matching build cannot be found.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Pass `arch='x86_64'`, `platform='linux'` (or appropriate values) to the `install` function to ensure the correct standalone build is selected.","message":"When installing Python for a different target environment (cross-compiling) or if auto-detection fails, explicitly specifying the `arch` and `platform` parameters in the `install` function is crucial. Omitting them might lead to downloading an incompatible Python build for the current system.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T15:02:18.348Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"pip install pbs-installer","cause":"The 'pbs-installer' package is not installed in the current Python environment or the environment is not properly activated.","error":"ModuleNotFoundError: No module named 'pbs_installer'"},{"fix":"Ensure the package is installed with `pip install pbs-installer`, then restart your terminal or verify that the Python environment's script directory is in your system's PATH.","cause":"The 'pbs-installer' command-line tool is not installed or its installation directory is not included in the system's PATH environment variable.","error":"pbs-installer: command not found"},{"fix":"Specify an installation directory where the current user has write permissions using the `--path` argument (e.g., `pbs-installer install 3.10.8 --path ~/.pythons/3.10.8`), or run the command with elevated privileges (`sudo pbs-installer ...`) if installing to a system-wide location is absolutely necessary (though generally discouraged for standalone builds).","cause":"The user is attempting to install a standalone Python build into a system-protected directory where they lack write permissions.","error":"OSError: [Errno 13] Permission denied: '/usr/local/python/3.10.8'"},{"fix":"Clear the local cache using `pbs-installer clear-cache` and then retry the installation. If the issue persists, verify your network connection or check the `python-build-standalone` GitHub releases for any reported issues with the specific build version.","cause":"The downloaded Python build file is corrupted, incomplete, or its checksum no longer matches the expected value, possibly due to a network issue, an interrupted download, or an upstream change to the build artifact.","error":"checksum mismatch for https://github.com/indygreg/python-build-standalone/releases/download/..."},{"fix":"Check the official `python-build-standalone` GitHub releases or the output of `pbs-installer list` for a list of available and supported Python versions for your platform, and use one of those.","cause":"The specified Python version (e.g., '3.10.99') does not have a pre-built standalone package available for the current operating system and architecture on the `python-build-standalone` releases page.","error":"No such Python build exists for version '3.10.99' for platform 'linux-x86_64'."}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.6,"disk_size":"18.5M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":2.6,"disk_size":"24.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.06,"mem_mb":2.6,"disk_size":"19M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.06,"mem_mb":2.6,"disk_size":"25M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.14,"mem_mb":2.8,"disk_size":"20.4M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.8,"disk_size":"26.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.12,"mem_mb":2.8,"disk_size":"21M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":2.8,"disk_size":"27M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.11,"mem_mb":2.8,"disk_size":"12.3M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.8,"disk_size":"18.4M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":2.8,"disk_size":"13M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.13,"mem_mb":2.8,"disk_size":"19M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.9,"disk_size":"11.9M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.9,"disk_size":"17.8M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.7,"disk_size":"12M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.7,"disk_size":"18M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.5,"disk_size":"18.0M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.05,"mem_mb":2.5,"disk_size":"23.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":2.5,"disk_size":"19M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.5,"disk_size":"24M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}