emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
3.04k stars 694 forks source link

emsdk install latest fails with "UnicodeDecodeError" #639

Open Squareys opened 4 years ago

Squareys commented 4 years ago

Hi all,

This happens when using latests master of emsdk (107dc62dd7fa90324d01658e6bcb514eca02d00a):

> emsdk update-tags
> emsdk install latest
Installing SDK 'sdk-releases-upstream-4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-64bit'..
Skipped installing node-12.18.1-64bit, already installed.
Skipped installing python-3.7.4-pywin32-64bit, already installed.
Skipped installing java-8.152-64bit, already installed.
Installing tool 'releases-upstream-4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-64bit'..
Downloading: D:/GitHub/emsdk/zips/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-wasm-binaries.zip from https://storage.googleapis.com/webassembly/emscripten-releases-builds/win/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87/wasm-binaries.zip, 412055275 Bytes
Unpacking 'D:/GitHub/emsdk/zips/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-wasm-binaries.zip' to 'D:/GitHub/emsdk/upstream'
Done installing tool 'releases-upstream-4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-64bit'.
Running post-install step: npm ci ...
Running post-install step: npm install google-closure-compiler-windows
Traceback (most recent call last):
  File "D:\GitHub\emsdk\\emsdk.py", line 3050, in <module>
    sys.exit(main())
  File "D:\GitHub\emsdk\\emsdk.py", line 3030, in main
    success = tool.install()
  File "D:\GitHub\emsdk\\emsdk.py", line 1818, in install
    return self.install_sdk()
  File "D:\GitHub\emsdk\\emsdk.py", line 1835, in install_sdk
    success = emscripten_npm_install(self, os.path.join(emsdk_path(), install_path, 'emscripten'))
  File "D:\GitHub\emsdk\\emsdk.py", line 1256, in emscripten_npm_install
    universal_newlines=True)
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 395, in check_output
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 474, in run
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 926, in communicate
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 617: character maps to <undefined>

Both on Git Bash and Windows CMD.

Best, Jonathan

Squareys commented 4 years ago

I tried checking out 2.0.4 of emsdk, but that did not fix the issue. Setting chcp 65001 as described in this stackoverflow fixed the issue for me.

sbc100 commented 4 years ago

Do you have PYTHONHOME set? Can you try unsetting it?

The path D:\obj\windows-release\37amd64_Release makes me think somehow the wrong python libraryes are being used, but we have code in emsdk.bat that is supposed to unset PYTHONHOME and make this work.

elo-siema commented 4 years ago

I tried checking out 2.0.4 of emsdk, but that did not fix the issue. Setting chcp 65001 as described in this stackoverflow fixed the issue for me.

Would you mind sharing the modified file? I can't quite figure out where to make this change.

Squareys commented 4 years ago

@elo-siema You can run that command before running emsdk, I didn't modify the code

fesieg commented 3 years ago

@Squareys which command? I can't seem to figure it out

Squareys commented 3 years ago

@fesieg You just type chcp 65001 in a cmd before running emsdk 😅

fernando18031993 commented 3 years ago

El vie., 9 de oct. de 2020 6:59 a. m., Jonathan Hale < notifications@github.com> escribió:

Hi all,

This happens when using latests master of emsdk (107dc62dd7fa90324d01658e6bcb514eca02d00a) http://107dc62dd7fa90324d01658e6bcb514eca02d00a:

emsdk update-tags emsdk install latest Installing SDK 'sdk-releases-upstream-4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-64bit'.. Skipped installing node-12.18.1-64bit, already installed. Skipped installing python-3.7.4-pywin32-64bit, already installed. Skipped installing java-8.152-64bit, already installed. Installing tool 'releases-upstream-4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-64bit'.. Downloading: D:/GitHub/emsdk/zips/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-wasm-binaries.zip from https://storage.googleapis.com/webassembly/emscripten-releases-builds/win/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87/wasm-binaries.zip, 412055275 Bytes Unpacking 'D:/GitHub/emsdk/zips/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-wasm-binaries.zip' to 'D:/GitHub/emsdk/upstream' Done installing tool 'releases-upstream-4ba921c8c8fe2e8cae071ca9889d5c27f5debd87-64bit'. Running post-install step: npm ci ... Running post-install step: npm install google-closure-compiler-windows Traceback (most recent call last): File "D:\GitHub\emsdk\emsdk.py", line 3050, in sys.exit(main()) File "D:\GitHub\emsdk\emsdk.py", line 3030, in main success = tool.install() File "D:\GitHub\emsdk\emsdk.py", line 1818, in install return self.install_sdk() File "D:\GitHub\emsdk\emsdk.py", line 1835, in install_sdk success = emscripten_npm_install(self, os.path.join(emsdk_path(), install_path, 'emscripten')) File "D:\GitHub\emsdk\emsdk.py", line 1256, in emscripten_npm_install universal_newlines=True) File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 395, in check_output File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 474, in run File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 926, in communicate File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cp1252.py", line 23, in decode UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 617: character maps to

Both on Git Bash and Windows CMD.

Best, Jonathan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/emscripten-core/emsdk/issues/639, or unsubscribe https://github.com/notifications/unsubscribe-auth/APSCI4TBBL5L4LQO2EHCCCLSJ33JJANCNFSM4SJ7QC4A .

sbc100 commented 3 years ago

I think this issue comes from using the wrong python libraries. The 37amd64_Release\msi_python\ paths in the error message make it looks like maybe PYTHONHOME is set when here?

auermich93 commented 3 years ago

Invoking chcp 65001 in cmd.exe (not powershell) resolved the issue for me.