问题
我的问题是我正在尝试使用cx_Freeze
为我的程序制作exe
,所以我运行了python setup.py build
,并且构建成功了,但是当我去了运行main.exe
,它给了我一个错误,说没有名为text
的模块。我的text.py
文件位于我的classes文件夹中。我也在使用python版本: 3.6.1
main.py
import sys
import pygame
import os
os.getcwd()
sys.path.append('classes/')
from text import *
from image import *
from player import *
from ball import *
from title import *
from cloud import *
from universal import *
setup.py
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"packages": ["sys", "pygame"], "excludes": ["tkinter"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "Pong",
version = "1.0",
description = "2 player pong",
options = {"build_exe": build_exe_options},
executables = [
Executable("main.py", base = base)
],
)