2017-02-15 67 views
0

我建立一个程序cx_Freeze(3.5.0 64位)在我的设置看起来像埃克从cx_Freeze程序缺少模块

from cx_Freeze import setup, Executable 
    setup(name='TOOL11', 
      version ='0.1', 
      description='Easily find best float combination', 
      executables = [Executable("TOOL11.py")]) 

但是当我运行这是在生成文件夹中的tool11.exe中, cmd快速打开和关闭。我记录了这种情况,并逐帧播放它看到的错误:https://i.gyazo.com/fe6ec4b8743e2348c48ee927ac8c1284.png 看来,错误是谷歌模块没有安装在生成文件夹。看到这个我添加了导入谷歌到我的TOOL11.py并试图再次构建。我试图再次运行该exe文件,但我得到了同样的错误。

有什么我可以做的,以解决这个问题?谢谢

回答

0

你不说你如何试图添加导入谷歌。 你试过这个吗?

from cx_Freeze import setup, Executable 
setup(name='TOOL11', 
     version ='0.1', 
     description='Easily find best float combination', 
     options={"build_exe": {"includes":["google"]}}, 
     executables = [Executable("TOOL11.py")]) 
+0

我试图通过在TOOL11.py文件中放入'import google'来添加google。设置(名称='TOOL11', 版本='0.1', description ='轻松找到最佳浮动组合', 选项='从cx_Freeze导入设置,可执行 选项= {“build_exe”:{“includes”:[“google”]}}, executables = [Executable(“TOOL11.py”)])' 但是出现此错误:http://pastebin.com/LTXCvi86 –

+0

其他解决方案:你可以下载这个文件:(https://github.com/google/protobuf/blob/master/python/google/protobuf/internal/python_message.py),把它放到你的steam文件夹中并修改这行' from google.protobuf.internal.python_message将GeneratedProtocolMessageType作为_ProtoMessageType引用到'from python_message import GeneratedProtocolMessageType as _ProtoMessageType' – VdF

+0

我在build \ exe.win-amd64-3.5 \ steam \ util有一个_init_文件,但它已经被编译并且看起来像这样:https://i.gyazo.com/ec19235655fcd0236af3a62d42d2b11f.png第10行也是空白的。这是你所说的文件/文件夹吗? –