Class PythonVersionManager

Constructors

Methods

  • Retrieves the local Python version set by pyenv.

    This function executes the 'pyenv local' command to get the currently set local Python version. It uses Node.js child process to spawn a shell command and capture its output.

    Returns Promise<string>

    A Promise that resolves with a string representing the local Python version. The version string is trimmed of any leading or trailing whitespace.

    Will reject the promise with an Error if the pyenv command fails to start or exits with a non-zero code.

  • Install a Python version using pyenv.

    Parameters

    • version: string

      The version string (e.g. "3.9.1")

    Returns Promise<void>

  • List all Python versions installed via pyenv.

    Returns Promise<string[]>

  • Set the local Python version via pyenv.

    Parameters

    • version: string

      The version to set as local.

    Returns Promise<void>

  • Uninstall a Python version using pyenv.

    Parameters

    • version: string

      The version string to uninstall.

    Returns Promise<void>