emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

python not recognized

Open ALImmortal opened this issue 8 years ago • 10 comments

I have just recently installed emscripten and I had went through the tutorial, updated whatever is needed. I got to specified folder to test emcc -v and I get 'python' is not recognized as an internal or external command, operable program or batch file. I am lost on how to resolve this problem.

ALImmortal avatar Dec 04 '17 17:12 ALImmortal

Here is what I put to be more clear. Let me know what I did wrong. C:\Users\owner\Desktop\Emscript\emscripten\1.37.22>emcc -v 'python' is not recognized as an internal or external command, operable program or batch file.

ALImmortal avatar Dec 04 '17 17:12 ALImmortal

Python (2.6 or later) needs to be installed, and added to the path, so that the windows shell environment can find it.

Did you install using the emsdk? It should handle that automatically. If you installed manually, then you may need to install python manually as well.

kripken avatar Dec 04 '17 20:12 kripken

@ALImmortal you probably forgot to call > emsdk activate latest

iboB avatar Feb 26 '18 18:02 iboB

I just tried this install install instructions described here: Download and install The python unrecognized is thrown by the >emsdk activate latest command. It looks like the default installations for Python 2.7.12 though Python 3.6.0, by default, set the Windows shell command to "py" instead of "python".

InsulinShock avatar May 03 '19 13:05 InsulinShock

Running into the same thing, but it worked when I ran it through GIT BASH

2timesjay avatar May 19 '19 20:05 2timesjay

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

stale[bot] avatar May 18 '20 21:05 stale[bot]

Still relevant when trying to run emscripten from git bash. The 'python' command works though, and is the right version

discapes avatar Jun 29 '22 10:06 discapes

Can you try running with bash -x $(which emcc) and and post the output here?

sbc100 avatar Jun 29 '22 10:06 sbc100

Sure.

$ bash -x $(which emcc)
+ unset _PYTHON_SYSCONFIGDATA_NAME
+ '[' -z '' ']'
+ PYTHON=
+ '[' -z '' ']'
++ command -v python3
+ PYTHON=/c/Users/Miika/AppData/Local/Microsoft/WindowsApps/python3
+ '[' -z /c/Users/Miika/AppData/Local/Microsoft/WindowsApps/python3 ']'
+ '[' -z /c/Users/Miika/AppData/Local/Microsoft/WindowsApps/python3 ']'
+ '[' -z '' ']'
+ exec /c/Users/Miika/AppData/Local/Microsoft/WindowsApps/python3 -E /c/Users/Miika/Downloads/emsdk/upstream/emscripten/emcc.py
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

Btw, fixed the issue by adding export EMSDK_PYTHON="$(which python)" to ~/.bash_profile

discapes avatar Jun 29 '22 10:06 discapes

So it looks like MS has installed some kind of python3 launcher/shim in /c/Users/Miika/AppData/Local/Microsoft/WindowsApps/python3 but it is non-functional?

export EMSDK_PYTHON="$(which python)" will only work if python happens to be python version 3.. which i seems like in your case it is? What does which python show BTW? Is it a version of python that comes with you git bash shell? Or a windows version of python?

sbc100 avatar Jun 29 '22 10:06 sbc100