Nov-27-2019, 11:01 PM
After a directory and register search, I found that Lilypond and MinGW had installed 'behind my back' Python 2.4.5 and Python 3.8.0, respectively. Since new paths in Windows are appended to the PATH environment variable and I installed Python 3.7.5 last, invoking python.exe resolved to the one in Python 2.4.5 (because I had installed Lilypond before MinGW) and python3.exe to the one in Python 3.8.0 (because there is no python3.exe in Python 2.4.5). As for py.exe, it is in the Windows directory (which has priority over all others) and I assume that (along with pyw.exe) it is replaced by the last Python installed, in this case Python 3.7.5.
The fix has been to move the path of the Python 3.7.5 (which is the one I need at the moment to be the default in my system) higher up in PATH than those of Python 2.4.5 and 3.8.0, and also to ammend the registry keys Computer\HKEY_CLASSES_ROOT\py_auto_file\shell\open\command and Computer\HKEY_CLASSES_ROOT\Python\shell\open\command so that their values point to the python.exe in my Python 3.7.5. (Warning: Tampering with the registry can hang the system.)
Problem solved.
In short: Make sure that the path of the Python you want to be the default in your system is higher up in PATH than that any other, keeping in mind that all sorts of programs install Python for their own use.
The fix has been to move the path of the Python 3.7.5 (which is the one I need at the moment to be the default in my system) higher up in PATH than those of Python 2.4.5 and 3.8.0, and also to ammend the registry keys Computer\HKEY_CLASSES_ROOT\py_auto_file\shell\open\command and Computer\HKEY_CLASSES_ROOT\Python\shell\open\command so that their values point to the python.exe in my Python 3.7.5. (Warning: Tampering with the registry can hang the system.)
Problem solved.
In short: Make sure that the path of the Python you want to be the default in your system is higher up in PATH than that any other, keeping in mind that all sorts of programs install Python for their own use.