我最近尝试用 cx_freeze 制作一个 .exe 程序,它通常可以工作。但是我已经开始使用 jsonpickle 作为一个模块,现在我的程序不再工作了。它们在空闲时运行,但是当我将它们变成 .exe 时,它们拒绝运行。我不知道会是什么问题。它还告诉我 jsonpickle 不是一个模块,即使我确实使用了那个模块。如果你需要我的 setup.py 文件,这里是:
import cx_Freeze, sys
from cx_Freeze import setup, Executable
exe=Executable(
script="gtn.py",
base="Console",
icon = "gtn.ico",
)
includefiles=[]
includes=["re"]
excludes=[]
packages=[]
setup(
version = "14w03a",
description = "oysterDev©",
author = "Austin Hargis",
name = "GTN",
options = {'build_exe': {'excludes':excludes,'packages':["jsonpickle"],'include_files':includefiles}},
executables = [exe]
)
这是我尝试运行 .exe 时收到的错误:
C:\Users\Austin\Desktop\build\exe.win32-3.4>gtn.exe
Traceback (most recent call last):
File "c:\python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
exec(code, m.__dict__)
File "gtn.py", line 3, in <module>
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2214, in _find_a
nd_load
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2201, in _find_a
nd_load_unlocked
ImportError: No module named 'jsonpickle'