Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Windows: "TypeError: Can't mix strings and bytes in path components" #177

Closed
umutzd opened this issue Oct 18, 2018 · 1 comment
Closed

Comments

@umutzd
Copy link

umutzd commented Oct 18, 2018

I tried installing on Windows 10 by using these commands:

git clone https://github.com/juj/emsdk.git cd emsdk ./emsdk install sdk-incoming-64bit binaryen-master-64bit ./emsdk activate sdk-incoming-64bit binaryen-master-64bit

And it failed after a lot of attempts with the same errors again:

PS C:\Users\HP\emsdk> ./emsdk install sdk-incoming-64bit binaryen-master-64bit
Installing SDK 'sdk-incoming-64bit'..
Installing tool 'clang-incoming-64bit'..
Repository 'https://github.com/kripken/emscripten-fastcomp.git' already cloned to directory 'C:/Users/HP/emsdk/clang/fastcomp\src', skipping.
Fetching latest changes to the branch 'incoming' for 'C:/Users/HP/emsdk/clang/fastcomp\src'...
Already up to date.
Successfully updated and checked out branch 'incoming' on repository 'C:/Users/HP/emsdk/clang/fastcomp\src'
Current repository version: "Wed, 10 Oct 2018 16:24:59 -0700 700797013be4bb38b131c0f36f0f562b90c7714a"
Repository 'https://github.com/kripken/emscripten-fastcomp-clang.git' already cloned to directory 'C:/Users/HP/emsdk/clang/fastcomp\src\tools/clang', skipping.
Fetching latest changes to the branch 'incoming' for 'C:/Users/HP/emsdk/clang/fastcomp\src\tools/clang'...
Already up to date.
Successfully updated and checked out branch 'incoming' on repository 'C:/Users/HP/emsdk/clang/fastcomp\src\tools/clang'
Current repository version: "Wed, 10 Oct 2018 16:24:55 -0700 8ea67b49fd5eeb86f177dcf9df4187a366212d60"
Running CMake: ['cmake', '-G', 'Visual Studio 14 Win64', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_EXECUTABLE=C:\Users\HP\AppData\Local\Programs\Python\Python35-32\python.exe', '-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_TESTS=OFF', '-DLLVM_ENABLE_ASSERTIONS=OFF', 'C:/Users/HP/emsdk/clang/fastcomp\src']
CMake Deprecation Warning at CMakeLists.txt:14 (cmake_policy):
The OLD behavior for policy CMP0051 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

CMake Warning at CMakeLists.txt:39 (message):
Visual Studio generators use the x86 host compiler by default, even for
64-bit targets. This can result in linker instability and out of memory
errors. To use the 64-bit host compiler, pass -Thost=x64 on the CMake
command line.

-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64-pc-win32
-- LLVM default target triple: x86_64-pc-win32
-- Using Debug VC++ CRT: MDd
-- Using Release VC++ CRT: MD
-- Using MinSizeRel VC++ CRT: MD
-- Using RelWithDebInfo VC++ CRT: MD
-- Using Release VC++ CRT: MD
-- Constructing LLVMBuild project information
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting X86
-- Targeting JSBackend
-- Clang version: 6.0.1
-- SampleAnalyzerPlugin ignored -- Loadable modules not supported on this platform.
-- PrintFunctionNames ignored -- Loadable modules not supported on this platform.
-- AnnotateFunctions ignored -- Loadable modules not supported on this platform.
-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/HP/emsdk/clang/fastcomp/build_incoming_vs2015_64
Performing a parallel build with 3 cores.
Traceback (most recent call last):
File "C:\Users\HP\emsdk/emsdk", line 2385, in
sys.exit(main())
File "C:\Users\HP\emsdk/emsdk", line 2368, in main
success = tool.install()
File "C:\Users\HP\emsdk/emsdk", line 1351, in install
success = tool.install()
File "C:\Users\HP\emsdk/emsdk", line 1361, in install
success = build_llvm_tool(self)
File "C:\Users\HP\emsdk/emsdk", line 864, in build_llvm_tool
success = make_build(build_root, build_type, 'x64' if tool.bitness == 64 else 'Win32')
File "C:\Users\HP\emsdk/emsdk", line 734, in make_build
generator_to_use = get_generator_for_sln_file(os.path.join(build_root, solution_name))
File "C:\Users\HP\AppData\Local\Programs\Python\Python35-32\lib\ntpath.py", line 113, in join
genericpath._check_arg_types('join', path, *paths)
File "C:\Users\HP\AppData\Local\Programs\Python\Python35-32\lib\genericpath.py", line 145, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components

Also this running this command will throw some errors as expected:

PS C:\Users\HP\emsdk> ./emsdk activate sdk-incoming-64bit binaryen-master-64bit
Writing .emscripten configuration file to user home directory C:\Users\HP/
Warning: The SDK/tool 'node-8.9.1-64bit' cannot be activated since it is not installed! Skipping this tool...
Warning: The SDK/tool 'python-2.7.13.1-64bit' cannot be activated since it is not installed! Skipping this tool...
Warning: The SDK/tool 'java-8.152-64bit' cannot be activated since it is not installed! Skipping this tool...
Warning: The SDK/tool 'emscripten-incoming-64bit' cannot be activated since it is not installed! Skipping this tool...
Warning: The SDK/tool 'binaryen-master-64bit' cannot be activated since it is not installed! Skipping this tool...
Warning: The SDK/tool 'sdk-incoming-64bit' cannot be activated since it is not installed! Skipping this tool...
Warning: The SDK/tool 'binaryen-master-64bit' cannot be activated since it is not installed! Skipping this tool...
The Emscripten configuration file C:\Users\HP.emscripten has been rewritten with the following contents:

import os
LLVM_ROOT='C:/Users/HP/emsdk/clang/fastcomp/build_incoming_vs2015_64/Release/bin'
SPIDERMONKEY_ENGINE = ''
NODE_JS = 'node'
V8_ENGINE = ''
TEMP_DIR = 'C:/Users/HP/AppData/Local/Temp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

Traceback (most recent call last):
File "C:\Users\HP\emsdk/emsdk", line 212, in win_get_environment_variable
import win32api, win32con
ImportError: No module named 'win32api'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\HP\emsdk/emsdk", line 2385, in
sys.exit(main())
File "C:\Users\HP\emsdk/emsdk", line 2321, in main
tools_to_activate = set_active_tools(tools_to_activate, permanently_activate=arg_global)
File "C:\Users\HP\emsdk/emsdk", line 1857, in set_active_tools
env_string = construct_env(tools_to_activate, False)
File "C:\Users\HP\emsdk/emsdk", line 1955, in construct_env
newpath, added_path = adjusted_path(tools_to_activate)
File "C:\Users\HP\emsdk/emsdk", line 1918, in adjusted_path
existing_path = win_get_environment_variable('PATH', system=True)
File "C:\Users\HP\emsdk/emsdk", line 219, in win_get_environment_variable
if e[0] != 2: # 'The system cannot find the file specified.'
TypeError: 'ImportError' object is not subscriptable

@juj juj closed this as completed in 7a0e274 Oct 23, 2018
@juj
Copy link
Collaborator

juj commented Oct 23, 2018

Thanks, this was a Python 3 issue. Fixed in above commit.

vargaz pushed a commit to vargaz/emsdk that referenced this issue Nov 22, 2023
* Workload changes and arcade update (emscripten-core#171) (emscripten-core#172)

* Update arcade to 7.0.0-beta.22416.1

* Workload changes

Co-authored-by: Larry Ewing <lewing@microsoft.com>

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>

* [release/7.0-rc1] Make two manifests one for net7 and one for net6 in 7.0.100 sdk band (emscripten-core#163)

* Here goes nothing

* Update WorkloadManifest.json.in

* Update WorkloadManifest.json.in

* Try to fix up the multi-targeted build. This will likely need an arcade change to enable manifests withtout packs and an additional change once arcade is updated.

* Update eng/emsdk.proj

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>

* Rename .pkgproj files

* Update PackageVersionNet6 to 6.0.9

* Fix the location of the .net7 pkgproj

Co-authored-by: Marc Paine <marcpop@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>

* [release/7.0-rc1] Shorten the name more (emscripten-core#174)

* Shorten the name more

* [release/7.0-rc1] Check nuget sizes and fix them (emscripten-core#175)

* yml: Fail if nuget size exceeds 250MiB, on linux, and macos

* Fix the case for no errors

* Remove unused binaries

Co-authored-by: Ankit Jain <radical@gmail.com>

* Add PowerShell-based NuGet size check script and use it on Windows (emscripten-core#176)

* Add PowerShell-based NuGet size check script and use it on Windows

* Update azure-pipelines.yml

* Roll back 6.0.x to 6.0.8 so that packages exist (emscripten-core#177)

* Revert "Roll back 6.0.x to 6.0.8 so that packages exist (emscripten-core#177)" (emscripten-core#178)

This reverts commit b7a5ae2.

* make a 6.0.4 build (emscripten-core#180)

* Revert "make a 6.0.4 build (emscripten-core#180)" (emscripten-core#181)

This reverts commit eb3232e.

* [release/7.0] Update arcade to 7.0.0-beta.22418.4 (emscripten-core#182)

* WorkloadManifest.targets: fix condition (emscripten-core#183)

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
Co-authored-by: Marc Paine <marcpop@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants