Skip to content

[enhancement]: on Windows, make use of the 'py' command line launcher, if available #3303

Open
@gogurtenjoyer

Description

@gogurtenjoyer

Is there an existing issue for this?

  • I have searched the existing issues

Contact Details

No response

What should this feature add?

On every operating system but Windows, we're able to make some assumptions about which python version we're referring to by being specific, such that we know python3.10 -V will return something along the lines of Python 3.10.x. On Windows, for whatever reason, this is not the case, as all python interpreters are named python.exe.

Currently, InvokeAI's automated installer requires a non-default option, 'Add python.exe to PATH', to be checked when installing the official package from python.org, or it'll fail. This is responsible for the vast majority of support issues that we see, and probably the popularity of the standalone version which was recently removed from itch.io. In addition, this option could inadvertently break the installation of other python-requiring software that also made this choice/requirement.

There's already a solution for this, and it's the py launcher that comes with every python installation from python.org. It accepts a version as the first argument to it, and is available in PATH without any non-default options checked. An example:

py -3.10 -V would be the same as python3.10 -V, and
py -3.10 -m pip install xformers would be the same as python3.10 -m pip install xformers.

This should hopefully be pretty easy to implement in the installer and would save many, many people a lot of time.

Alternatives

Not so much an alternative, but a counterpoint: the py launcher isn't included with the python from the microsoft store, so this proposal wouldn't help there.

An alternative might be to just require that the end user chooses the right python to launch the installer, with some documentation explaining the various ways to provide that, depending upon how python was installed.

Aditional Content

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions