Skip to content

pymanager automatic install is trying to install a prerelease version of Python by default that isn't in the index #138

@splatteredbits

Description

@splatteredbits

Describe the bug

We use a custom index that currently lists only Python 3.13, 3.13t, 3.12, and 3.11. We omit 3.14 because it is a prerelease version. When a user first runs Python, it attempts and fails to install 3.14, even though it isn't in the index:

> python -c "import sys; print(sys.executable);"
Welcome to the Python installation manager configuration helper.

********************************************************************************

You do not have any Python runtimes installed.

Install the current latest version of CPython? If not, you can use 'py install
default' later to install, or one will be installed automatically when needed.

********************************************************************************
[ERROR] Failed to find a suitable install for '3.14'.

To Reproduce

Steps to reproduce the behavior:

  1. Download this index.json file.
  2. Set PYTHON_MANAGER_SOURCE_URL env var to point to that file.
  3. Set PYTHON_MANAGER_CONFIRM env var to false.
  4. Run python -c "import sys; print(sys.executable);" and note the error.

Expected behavior

I would expect it to install 3.13, the latest version in the index.

Additional context

I'm trying to get unattended installs working on Jenkins build agent servers. Our build agents runs as a specific user, so Python has to auto-install with no problems when a non-interactive build on a server first runs python.

Yes, I could use the PYTHON_MANAGER_DEFAULT environment variable, but I don't want to. That's one more thing for me to manage, and it's a version number, which means I have to continue to manage it as new versions of Python are installed.

Docs also explicitly state that it won't attempt to install a prerelease version by default:

The preferred default version to launch or install. By default, this is interpreted as the most recent non-prerelease version from the CPython team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions