Skip to content

Python3 installer is broken on Windows #99923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
juj opened this issue Dec 1, 2022 · 10 comments
Closed

Python3 installer is broken on Windows #99923

juj opened this issue Dec 1, 2022 · 10 comments
Labels
OS-windows topic-installation type-bug An unexpected behavior, bug, or error

Comments

@juj
Copy link

juj commented Dec 1, 2022

I was unable to find the appropriate GitHub repository for the Windows installer, so reporting this here to get visibility somewhere at least.

Steps To Reproduce:

  1. Visit python.org to download Python 3.11 for Windows:

image

  1. Launch the installer, choose e.g. the following options (shouldn't matter much, except note to add Python to PATH):

image

image

image

  1. After installation finishes, open a new command prompt, and type python3:

image

and press enter.

Observed: The Microsoft Store page pops up, asking the user to install Python 3.10:

image

Expected: The just installed python 3.11 interpreter should launch.

@juj juj added the type-bug An unexpected behavior, bug, or error label Dec 1, 2022
@juj
Copy link
Author

juj commented Dec 1, 2022

As a workaround, looks like one can copy C:\python311\python.exe over to C:\python311\python3.exe, but that should have been done by the installer?

@pochmann
Copy link
Contributor

pochmann commented Dec 1, 2022

Why are you typing python3 instead of python? You chose the option "Add python.exe to PATH", not "Add python3.exe to PATH", so why do you expect there to be a python3.exe?

@juj
Copy link
Author

juj commented Dec 1, 2022

Why are you typing python3 instead of python

I am trying to build the Google v8 JS shell, which uses depot_tools(https://www.chromium.org/developers/how-tos/install-depot-tools/) package, which invokes python3 as part of its build script.

If that is the wrong thing to do and python3 should not be executed on Windows (which is odd given PEP 394 which suggests that on Unix-likes Python 3 may be present via invoking python3, not sure why it would be any different for Windows), I can raise this as a bug report against depot_tools, though it does not seem like this would be Google's fault.

You chose the option "Add python.exe to PATH", not "Add python3.exe to PATH"

There is no option "Add python3.exe to PATH" in the installer. Maybe such an option should then be added, if that is the problem?

why do you expect there to be a python3.exe?

Among other things because of that PEP 394, which states

"When invoked, python2 should run some version of the Python 2 interpreter, and python3 should run some version of the Python 3 interpreter."

@pochmann
Copy link
Contributor

pochmann commented Dec 1, 2022

PEP 394's name is "The “python” Command on Unix-Like Systems", and Windows is no Unix-like system. It even has a section Exclusion of MS Windows which says "This PEP deliberately excludes any proposals relating to Microsoft Windows".

If Python doesn't promise the existence of python3, then its non-existence isn't a bug in Python but in the other software that assumes its existence.

The depot_tools setup tutorial mentions python.exe but not python3.exe, so looks like depot_tools even already knows the correct name...

@juj
Copy link
Author

juj commented Dec 1, 2022

I am not following a setup tutorial, but I am running the automated depot_tools build script, which programmatically invokes python3 on Windows.

If Python doesn't promise the existence of python3, then its non-existence isn't a bug in Python but in the other software that assumes its existence.

What is the point of devising the whole python2, python3 scheme if one OS is deliberately excluded from it? Why deliberately break cross-platform compatibility? There are no downsides to having python3.exe also on Windows Python 3 installations.

@juj
Copy link
Author

juj commented Dec 1, 2022

Raised a bug report against depot_tools in Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1395090

@eryksun
Copy link
Contributor

eryksun commented Dec 1, 2022

As a workaround, looks like one can copy C:\python311\python.exe over to C:\python311\python3.exe

If you create a symlink, then you won't have to manually replace "python3.exe" if you do an in-place update. For example:

>>> import os, sys
>>> dst = os.path.join(os.path.dirname(sys.executable), 'python3.exe')
>>> os.symlink('python.exe', dst)

@iritkatriel
Copy link
Member

Is there anything left to do here?

@iritkatriel iritkatriel added the pending The issue will be closed if no feedback is provided label Apr 5, 2023
@juj
Copy link
Author

juj commented Apr 5, 2023

I agree with ecmziegler on depot_tools bug tracker, who commented

Though I think they make it unnecessarily hard on Windows for cross-platform applications. Just because
the spec does not require it does not mean it can't be done.

I still think Windows installations of Python 3 should provide python3.exe. The rationales above of why not do not seem particularly convincing.

@iritkatriel iritkatriel removed the pending The issue will be closed if no feedback is provided label May 20, 2023
@zooba
Copy link
Member

zooba commented Feb 1, 2024

Closing this as a dup of #99185

@zooba zooba closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows topic-installation type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

6 participants