Nuitka / Nuitka

Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.4-3.12. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.
http://nuitka.net
Apache License 2.0
11.99k stars 646 forks source link

When first run test.py get Error: TypeError: write() argument must be str, not bytes: #584

Closed zinken7 closed 4 years ago

zinken7 commented 4 years ago

I try to use nuitka. After install, I run:

python -m nuitka --standalone test.py 

With my test.py

print("helo")

It has error:

TypeError: write() argument must be str, not bytes:
  File "Z:\Python\lib\site-packages\nuitka\build\SingleExe.scons", line 514:
    env = createEnvironment(tools=compiler_tools)
  File "Z:\Python\lib\site-packages\nuitka\build\SingleExe.scons", line 499:
    **args
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Environment.py", line 991:
    apply_tools(self, tools, toolpath)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Environment.py", line 107:
    env.Tool(tool)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Environment.py", line 1798:
    tool(self)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\__init__.py", line 306:
    self.generate(env, *args, **kw)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\default.py", line 41:
    SCons.Tool.Tool(t)(env)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\__init__.py", line 306:
    self.generate(env, *args, **kw)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\mslink.py", line 314:
    msvc_setup_env_once(env)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\MSCommon\vc.py", line 654:
    msvc_setup_env(env)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\MSCommon\vc.py", line 773:
    d = msvc_find_valid_batch_script(env,version)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\MSCommon\vc.py", line 721:
    d = script_env(vc_script, args=arg)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\MSCommon\vc.py", line 600:
    stdout = common.get_output(script, args)
  File "Z:\Python\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.1.0\SCons\Tool\MSCommon\common.py", line 203:
    sys.stderr.write(stderr)

python -m nuitka --version

0.6.5
Python: 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
Executable: Z:\Python\python.exe
OS: Windows
Arch: x86
kayhayen commented 4 years ago

This seems to be a scons problem, that I have no idea about. Also you didn't try develop, did you? And it is unclear, which MSVC is being attempted to be detected there and fails in this way.

kayhayen commented 4 years ago

Closing for lack of feedback.