我正在尝试将我的python3.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")] , )我得到了这个错误代码:
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。
发布于 2015-06-29 18:21:33
这一行似乎失败了argsSource.base = self._GetFileName("bases", name, ext),这意味着它找不到那个文件,这是有意义的。检查此文件夹C:\Python27\Lib\site-packages\cx_Freeze\bases以获得Console.exe。如果没有,那么尝试重新安装cx_freeze。这是我的python目录。我会假设你的在同一个地方,但如果不只是寻找它
发布于 2018-07-08 07:31:20
只需键入cmd "pip卸载cx_Freeze“以卸载cx_Freeze,然后再次通过键入"pip cx_Freeze”重新安装。
https://stackoverflow.com/questions/31122574
复制相似问题