Search code examples
pythonlinuxbuildcx-freeze

cx_Freeze: no base named Console


I am trying to compile a simple "Hello, world!" python script using cx_freeze (linux). I installed cx-freeze via the SourceForge tar file, because I had to apply this patch.

However, when I run:

cx_Freeze-4.3.3$ ./cxfreeze hello.py 
Traceback (most recent call last):
  File "./cxfreeze", line 5, in <module>
    main()
  File "cx_Freeze-4.3.3/cx_Freeze/main.py", line 187, in main
    silent = options.silent)
  File "cx_Freeze-4.3.3/cx_Freeze/freezer.py", line 108, in __init__
    self._VerifyConfiguration()
  File "cx_Freeze-4.3.3/cx_Freeze/freezer.py", line 488, in _VerifyConfiguration
    self._GetBaseFileName()
  File "cx_Freeze-4.3.3/cx_Freeze/freezer.py", line 211, in _GetBaseFileName
    raise ConfigError("no base named %s", name)
cx_Freeze.freezer.ConfigError: no base named Console

Solution

  • I just solved the problem by changing

    ext = ".exe" if sys.platform == "win32" else ""
    

    to

    ext = ".exe" if sys.platform == "win32" else ".py"
    

    in file freezer.py