cx_freeze error "cx_Freeze.freezer.ConfigError: no base named Console"

cx_freeze error "cx_Freeze.freezer.ConfigError: no base named Console"

我正在尝试将我的 python 3.4 程序转换为 exe 以供分发。我尝试使用 cx_Freeze 来做到这一点。但是,当我 运行 python setup.py 使用此构建时 setup.py:

from cx_Freeze import setup, Executable

setup( name = "Converter" ,
   version = "0.1" ,
   description = "" ,
   executables = [Executable("filename.py")] , )

我得到这个错误代码:

C:\Python34>python setup.py build
running build
running build_exe
Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    executables = [Executable("helloworld.py")] , )
  File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
    distutils.core.setup(**attrs)
  File "C:\Python34\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Python34\lib\distutils\command\build.py", line 126, in run
    self.run_command(cmd_name)
  File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 231, in run
    metadata = metadata)
  File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 136, in __init__
    self._VerifyConfiguration()
  File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 504, in _VerifyConfiguration
    self._GetBaseFileName()
  File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 239, in _GetBaseFileName
    raise ConfigError("no base named %s", name)
cx_Freeze.freezer.ConfigError: no base named Console

当我尝试设置 hello world 文件时,出现了同样的错误代码。所以和我的脚本没有关系。

有什么帮助吗?这是我第一次使用 cx_Freeze.

这行似乎失败了 argsSource.base = self._GetFileName("bases", name, ext) 这意味着它找不到该文件,这是有道理的。检查此文件夹 C:\Python27\Lib\site-packages\cx_Freeze\bases 是否有 Console.exe。如果没有,请尝试重新安装 cx_freeze。那是我 python 的目录。我会假设你的在同一个地方,但如果不只是搜索它

只需输入 cmd "pip uninstall cx_Freeze" 卸载 cx_Freeze 并再次输入 "pip install cx_Freeze".

重新安装