Hi there! I’m trying to package an additional tkinter tool with my game, but it’s crashing whenever I start it up. As you’ll see further below, I’ve made sure to put tkinter and Pmw in the “include_modules” option, but I get the below error:
Traceback (most recent call last):
File "__main__", line 390, in <module>
File "__main__", line 33, in __init__
File "direct.showbase.ShowBase", line 3197, in startTk
File "direct.showbase.ShowBase", line 3212, in spawnTkLoop
File "importlib", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1176, in exec_module
File "Pmw", line 31, in <module>
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\trici\\Documents\\GitHub\\AquaShift-Engine\\build\\win_amd64\\Lib\\Pmw'
For additional reference, here is my setup.py:
from main import game#Used for getting configuration of game
print("You are trying to build: " + game.app_name + " version " + game.version)
input("Would you like to continue? <ENTER>")
from multiprocessing import process
from setuptools import setup
import autoGenerateCode#Generates tables of entities that can be created on level load
from subprocess import call as subCall
from shutil import copyfile
from os import path
with open( path.join(path.dirname(__file__), path.normpath("models/maps/123_included_maps.txt")), "r" ) as includeFile:
includeMaps = []
for mapFile in includeFile.readlines():
includeMaps.append(mapFile.replace("\n", ""))
#print(includeMaps)
def process_egg(build_cmd, srcPath, desPath):
if "maps" in srcPath:
for mapFile in includeMaps:
if mapFile in srcPath:
break
else:
return
copyfile(srcPath, desPath)
else:
desPath += ".bam"
subCall(["egg2bam", srcPath, desPath])
setup(
name='World Users',
options={
'build_apps': {
'gui_apps': {
'play_game': 'main.py',
'animConSeqEditor': 'animConSeqEditor.py'
},
'macos_main_app' : 'main.py',
# Set up output logging, important for GUI apps!
'log_filename': '$USER_APPDATA/lifelandPandadev/output.log',
'log_append': False,
# Specify which files are included with the distribution
'include_patterns': [
'**/*.jpg',
'**/*.png',
'**/*.egg',
'**/*.prc',
'**/*.wav',
'**/*.frag',
'**/*.vert'
],
'exclude_patterns': {
#'models/maps/*'
},
'include_modules':{
"animConSeqEditor":[
"tkinter",
"Pmw",
]
},
'file_handlers':{
".egg":process_egg,
},
# Include the OpenGL renderer and OpenAL audio plug-in
'plugins': [
'pandagl',
'p3openal_audio',
'pandaegg'
],
'platforms':[
'manylinux2014_x86_64',
'win_amd64',
]
}
}
)