【问题标题】:Error Message when opening python program created with cx Freeze打开使用 cx Freeze 创建的 python 程序时出现错误消息
【发布时间】:2014-11-20 17:01:36
【问题描述】:

我想使用 python 和 cx_Freeze 制作一个可运行的程序。

脚本使用 csv、socket、ipaddress、threading 和 tkinter 包。 当我打开该工具时,我看到下面显示的错误消息。

这是进口的问题吗?还是我做错了什么?

这是我的安装脚本的样子:

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["tkinter","socket","csv","struct","threading","ipaddress"], "excludes": []}


# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if (sys.platform == "win32"):
    base = "Win32GUI"


setup(
    name = "CSV Tool",
    version = "0.1",
    description = "Tool to work with data to create CSV to import with uCMDB",
    options = {"build_exe": build_exe_options},
    executables = [Executable("csv_tool.py", base = base)])

PS:是win8.1 64位系统配python3.4

提前感谢您的帮助

【问题讨论】:

  • 您似乎在使用 32 位库,您确定其他所有内容都是 32 位的吗?
  • 我不知道为什么错误信息中有这个路径...正如您在第三行中看到的那样,我的python安装在另一个目录中。 c:\python 不存在...我没有安装除 python3.4 以外的任何其他软件包,并且除了开箱即用的软件包之外我没有使用任何其他软件包
  • 好的,检查你的 PYTHONPATH 环境变量。运行cmd.exe 并输入set
  • 这是 cx_Freeze 的一个已知问题。从this site 下载以获取修复。

标签: python python-3.x tkinter cx-freeze


【解决方案1】:

正如 Thomas 所说,this site 的 cx_Freeze 设置有助于防止错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-22
    • 2015-11-19
    • 2016-12-11
    • 2019-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多