cx_freeze错误“cx_Freeze.freezer.ConfigError:没有名为Console的基地”

时间:2021-12-18 18:03:17

I'm trying to convert a python 3.4 program of mine into an exe for distribution. I tried using cx_Freeze to do this. However, when I run python setup.py build with this setup.py:

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

from cx_Freeze import setup, Executable

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

I get this error code:

我收到此错误代码:

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

This same error code occurs when I try to setup for a hello world file. So it has nothing to do with my script.

当我尝试设置hello world文件时,会出现相同的错误代码。所以它与我的脚本无关。

Any help? This is the first time I've used cx_Freeze.

有帮助吗?这是我第一次使用cx_Freeze。

2 个解决方案

#1


2  

It appears that this line is failing argsSource.base = self._GetFileName("bases", name, ext) which means that it can't find that file, which makes sense. Check this folder C:\Python27\Lib\site-packages\cx_Freeze\bases for Console.exe. If you don't have that then try reinstalling cx_freeze. That's my directory for python. I would assume yours is in the same place but if not just search for it

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

#2


0  

Just type in cmd "pip uninstall cx_Freeze" for uninstall cx_Freeze and again reinstall it by type "pip install cx_Freeze".

只需输入cmd“pip uninstall cx_Freeze”即可卸载cx_Freeze,然后再按类型“pip install cx_Freeze”重新安装。

#1


2  

It appears that this line is failing argsSource.base = self._GetFileName("bases", name, ext) which means that it can't find that file, which makes sense. Check this folder C:\Python27\Lib\site-packages\cx_Freeze\bases for Console.exe. If you don't have that then try reinstalling cx_freeze. That's my directory for python. I would assume yours is in the same place but if not just search for it

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

#2


0  

Just type in cmd "pip uninstall cx_Freeze" for uninstall cx_Freeze and again reinstall it by type "pip install cx_Freeze".

只需输入cmd“pip uninstall cx_Freeze”即可卸载cx_Freeze,然后再按类型“pip install cx_Freeze”重新安装。