KhronosGroup/OpenXR-Hpp

Generator script expects python3 on Windows

Wyverex42 opened this issue · 1 comments

generate-openxr-hpp.ps1 currently expects the Python executable to be named python3. However, that's not always the case. If you install Python via https://www.python.org/downloads/, the executable is called python, even though it's v3 and not v2. Not sure if that has changed with any particular minor version of Python. Maybe the executable downloaded from the Microsoft store is still called python3 (as alluded to in the error message below).

PS C:\dev\OpenXR-1.0.26\OpenXR-Hpp> .\generate-openxr-hpp.ps1
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Generation failed while generating openxr_atoms.hpp :
At C:\dev\OpenXR-1.0.26\OpenXR-Hpp\generate-openxr-hpp.ps1:58 char:9
+         throw "Generation failed while generating ${header} : ${proce ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Generation fail...xr_atoms.hpp : :String) [], RuntimeException
    + FullyQualifiedErrorId : Generation failed while generating openxr_atoms.hpp :

PS C:\dev\OpenXR-1.0.26\OpenXR-Hpp> python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

Bottom line is that the script should be more lenient towards the name of the executable and potentially try both?

Ah good catch. I install python with scoop normally which makes it called python3 but I do remember that other installer methods don't have the suffix. Trying both would be a good idea.