【问题标题】:cx_Freeze app cannot find tk.tclcx_Freeze 应用程序找不到 tk.tcl
【发布时间】:2014-11-22 18:54:03
【问题描述】:

我想使用 cx_Freeze 分发一个 tkinter 应用程序。

  • 我可以从命令行运行 myapp.py。
  • cx_Freeze 创建一个名为“exe.macosx-10.6-x86_64-3.4”的文件夹,osx exe 从这里运行。
  • myapp.app 中的 osx exe 产生以下错误:

    `tkinter.TclError: Can't find a usable tk.tcl in the following directories:` 
    ....    
    
    This probably means that tk wasn't installed properly.
    

这是我的精简 setup.py

build_exe_options = {"modules": ["tkinter", "time", "requests", "threading", "os"]}

setup(name="myapp",
      option={"build_exe": build_exe_options},
      executables=[Executable("myapp.py",
                              base=base)]
      )

编辑:我尝试使用 python 2.7 进行此操作,并且可以正常工作。 “这可能意味着 tk 没有正确安装”这行可能是正确的。

【问题讨论】:

    标签: python tkinter cx-freeze


    【解决方案1】:

    我在 mac Yosemite 上遇到了同样的问题。系统python是2.7,我使用的是python3。我发现 python2.7 使用 tkinter 成功构建,但 3.4 没有。

    还没弄清楚如何让python3.4工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-25
      • 2015-12-15
      • 1970-01-01
      • 2015-01-05
      • 1970-01-01
      • 2021-09-06
      • 2020-02-04
      • 1970-01-01
      相关资源
      最近更新 更多