emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
2.92k stars 662 forks source link

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. #1316

Open vault-thirteen opened 7 months ago

vault-thirteen commented 7 months ago

The bundled Python is not found by emcmake !

It's folder was added manually into the PATH variable but it is still "not found". How is it possible ?

D:\Temp\2>emcmake cmake . -G "MSYS Makefiles"
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
D:\Temp\2>echo %PATH%
/* a lot of stuff here */;D:\msys64\usr\bin;D:\Temp\1\emsdk;D:\Temp\1\emsdk\node\16.20.0_64bit\bin;D:\Temp\1\emsdk\upstream\emscripten;D:\Temp\1\emsdk\python\3.9.2-nuget_64bit;
D:\Temp\2>cd D:\Temp\1\emsdk\python\3.9.2-nuget_64bit

D:\Temp\1\emsdk\python\3.9.2-nuget_64bit>dir
 Volume in drive D is G-500
 Volume Serial Number is ****-****

 Directory of D:\Temp\1\emsdk\python\3.9.2-nuget_64bit

02.12.2023  16:14    <DIR>          .
02.12.2023  16:14    <DIR>          ..
02.12.2023  16:14                26 .emsdk_version
02.12.2023  16:14    <DIR>          DLLs
02.12.2023  16:14    <DIR>          include
02.12.2023  16:15    <DIR>          Lib
02.12.2023  16:14    <DIR>          libs
02.12.2023  16:14            32 628 LICENSE.txt
02.12.2023  16:14           101 552 python.exe
02.12.2023  16:14            59 568 python3.dll
02.12.2023  16:14         4 457 136 python39.dll
02.12.2023  16:14           100 016 pythonw.exe
02.12.2023  16:14    <DIR>          Tools
02.12.2023  16:14            94 088 vcruntime140.dll
02.12.2023  16:14            36 744 vcruntime140_1.dll
               8 File(s)      4 881 758 bytes
               7 Dir(s)  359 241 998 336 bytes free
sbc100 commented 7 months ago

The idea is the running emsdk active latest and then emsdk_env.bat/emsdk_env.sh will set EMSDK_PYTHON which and add emscripten to your PATH. python.exe is not added to that PATH since we don't want to interfere with any existing python installation.

See https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended

vault-thirteen commented 7 months ago

The idea is the running emsdk active latest and then emsdk_env.bat/emsdk_env.sh

I thought that if I use the --permanent argument, then I do not need to run the emsdk_env script. Usage of this --permanent argument should be documented.

sbc100 commented 7 months ago

The idea is the running emsdk active latest and then emsdk_env.bat/emsdk_env.sh

I thought that if I use the --permanent argument, then I do not need to run the emsdk_env script. Usage of this --permanent argument should be documented.

Yes, if you use --permanent you don't need to use emsdk_env. emsdk_env is way to inject the settings in the current shell.

sbc100 commented 7 months ago

However, under no circumstances do we ever add python.exe to the user's PATH.

vault-thirteen commented 7 months ago

I think this should be documented. Because I see the python folder and consider that it should be automatically used but it turns out that I should use an external python.

vault-thirteen commented 7 months ago

https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended

Windows Install Python 3.6 or newer (older versions may not work due to a GitHub change with SSL).

It would be great to mention there that an external python should be installed before installation of the Emscripten tool and that the Emscripten tool comes with a bundled python which is for internal usage only so that it should not be used anyhow by a user.