cx_Freeze不导入python文件

时间:2017-05-28 19:23:08

标签: python cx-freeze

问题

我的问题是我正在尝试使用cx_Freeze为我的程序制作exe,所以我运行了python setup.py build,并且构建成功了,但是当我去了运行main.exe,它给了我一个错误,说没有名为text的模块。我的text.py文件位于我的classes文件夹中。我也在使用python版本: 3.6.1

Image of the error

Image of my folder structure

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)
      ],

)

0 个答案:

没有答案