building game error

im trying to use pfreeze but its not working

couldn't import toontown
couldn't import otp
couldn't import direct.extensions
couldn't import direct.extensions
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Developer/Panda3D/direct/showutil/pfreeze.py", line 117, in <module>
    freezer.done(compileToExe = compileToExe)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 886, in done
    self.__loadModule(mdef)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 976, in __loadModule
    self.mf.load_module(mdef.moduleName, fp, pathname, stuff)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 127, in import_hook
    m = self.load_tail(q, tail)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 204, in load_tail
    m = self.import_module(head, mname, m)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1392, in import_module
    return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 274, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 126, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 182, in find_head_package
    q = self.import_module(head, qname, parent)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1392, in import_module
    return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 274, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 126, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 182, in find_head_package
    q = self.import_module(head, qname, parent)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1392, in import_module
    return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 274, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 127, in import_hook
    m = self.load_tail(q, tail)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 204, in load_tail
    m = self.import_module(head, mname, m)
  File "/Developer/Panda3D/direct/showutil/FreezeTool.py", line 1387, in import_module
    libname = m.__libraries__[-1]
AttributeError: 'module' object has no attribute '__libraries__'

toontown and otp are the folders in my game

here is the whole script

import argparse
import os


parser = argparse.ArgumentParser()
parser.add_argument('--panda3d-dir', default='/developer/Panda3D',
                    help='The path to the Panda3D build to use for this distribution.')
parser.add_argument('--main-module', default='/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toontown/toonbase/ToontownStart.py',
                    help='The path to the instantiation module.')
parser.add_argument('--build-secret', default='dev',
                    help='The secret that will be used to encrypt the build.')
parser.add_argument('modules', nargs='*', default=['toontown', 'otp'],
                    help='The Toontown World modules to be included in the build.')
args = parser.parse_args()

print 'Building the client...'

os.chdir('build')

cmd = ' /usr/bin/ppython'  # ppython
cmd += ' -m direct.showutil.pfreeze'  # pfreeze
args.modules.extend(['direct', 'pandac'])
for module in args.modules:
    cmd += ' -i {0}.*.*'.format(module)
cmd += ' -i {0}.*'.format('encodings')
cmd += ' -i {0}'.format('base64')
cmd += ' -i {0}'.format('site')
cmd += ' -o GameData.pyd'  # The filename of the built *.PYD.
cmd += ' {0}'.format(args.main_module)  # "main" module

os.system(cmd)

print 'Done building the client.'

bump

ok now its just it cant find direct.extensions

Building the client...
couldn't import direct.extensions
couldn't import direct.extensions
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/build/direct/showutil/pfreeze.py", line 117, in <module>
    freezer.done(compileToExe = compileToExe)
  File "direct/showutil/FreezeTool.py", line 886, in done
    self.__loadModule(mdef)
  File "direct/showutil/FreezeTool.py", line 976, in __loadModule
    self.mf.load_module(mdef.moduleName, fp, pathname, stuff)
  File "direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 127, in import_hook
    m = self.load_tail(q, tail)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 204, in load_tail
    m = self.import_module(head, mname, m)
  File "direct/showutil/FreezeTool.py", line 1392, in import_module
    return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 274, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 126, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 182, in find_head_package
    q = self.import_module(head, qname, parent)
  File "direct/showutil/FreezeTool.py", line 1392, in import_module
    return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 274, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 126, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 182, in find_head_package
    q = self.import_module(head, qname, parent)
  File "direct/showutil/FreezeTool.py", line 1392, in import_module
    return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 274, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "direct/showutil/FreezeTool.py", line 1437, in load_module
    return modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 127, in import_hook
    m = self.load_tail(q, tail)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/modulefinder.py", line 204, in load_tail
    m = self.import_module(head, mname, m)
  File "direct/showutil/FreezeTool.py", line 1387, in import_module
    libname = m.__libraries__[-1]
AttributeError: 'module' object has no attribute '__libraries__'
Done building the client.

the code of the building file

import argparse
import os


parser = argparse.ArgumentParser()
parser.add_argument('--panda3d-dir', default='/developer/Panda3D',
                    help='The path to the Panda3D build to use for this distribution.')
parser.add_argument('--main-module', default='/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toontown/toonbase/ToontownStartDist.py',
                    help='The path to the instantiation module.')
parser.add_argument('--build-secret', default='dev',
                    help='The secret that will be used to encrypt the build.')
parser.add_argument('modules', nargs='*', default=['toontown', 'otp'],
                    help='The Toontown World modules to be included in the build.')
args = parser.parse_args()
print 'Building the client...'

os.chdir('build')

cmd = ' /usr/bin/ppython'  # ppython
cmd += ' -m direct.showutil.pfreeze'  # pfreeze

args.modules.extend(['direct', 'pandac'])
for module in args.modules:
    cmd += ' -i {0}.*.*'.format(module)
cmd += ' -i {0}.*'.format('encodings')
cmd += ' -i {0}'.format('base64')
cmd += ' -i {0}'.format('site')
cmd += ' -o GameData.pyd'  # The filename of the built *.PYD.
cmd += ' {0}'.format(args.main_module)  # "main" module

os.system(cmd)

print 'Done building the client.'

shorter version of code

os.chdir('build')

cmd = ' /usr/bin/ppython'  # ppython
cmd += ' -m direct.showutil.pfreeze'  # pfreeze

args.modules.extend(['direct', 'pandac'])
for module in args.modules:
    cmd += ' -i {0}.*.*'.format(module)
cmd += ' -i {0}.*'.format('encodings')
cmd += ' -i {0}'.format('base64')
cmd += ' -i {0}'.format('site')
cmd += ' -o GameData.pyd'  # The filename of the built *.PYD.
cmd += ' {0}'.format(args.main_module)  # "main" module

os.system(cmd)

This is a limitation in the old version of FreezeTool. I just checked in a fix to FreezeTool.py in CVS.
panda3d.cvs.sourceforge.net/view … ezeTool.py

i applied the new one still same error.

You may not have replaced the right copy of FreezeTool.py. Try finding the file on your computer to make sure that there’s not a copy of that file around that you may be missing.

ok thanks

now i get missing module errors oh no :frowning:
actually more like warnnings

idk if u can help me with this or not
log:

GameData.c:7:24: error: expected ';' after top level declarator
static unsigned char M_/Users/michaelgray/Desktop/ToontownWorldclient/To...
                       ^
                       ;
GameData.c:1506488:112: error: use of undeclared identifier 'Users'
  ...M_/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toon...
        ^
GameData.c:1506488:118: error: use of undeclared identifier 'michaelgray'
  ...M_/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toon...
              ^
GameData.c:1506488:130: error: use of undeclared identifier 'Desktop'
  ...M_/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toon...
                          ^
GameData.c:1506488:138: error: use of undeclared identifier
      'ToontownWorldclient'
  ...M_/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toon...
                                  ^
GameData.c:1506488:158: error: use of undeclared identifier 'ToontownWorldRetro'
  ...M_/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/toon...
                                                      ^
GameData.c:1506488:177: error: use of undeclared identifier 'toontown'; did you
      mean 'M_toontown'?
  ...toontown/toonbase/ToontownStartDist, 5078},
     ^~~~~~~~
     M_toontown
GameData.c:568698:22: note: 'M_toontown' declared here
static unsigned char M_toontown[] = {
                     ^
GameData.c:1506488:186: error: use of undeclared identifier 'toonbase'
  ...toonbase/ToontownStartDist, 5078},
     ^
GameData.c:1506488:195: error: use of undeclared identifier 'ToontownStartDist'
  ...ToontownStartDist, 5078},
     ^
9 errors generated.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/michaelgray/Desktop/ToontownWorldclient/ToontownWorldRetro/build/direct/showutil/pfreeze.py", line 122, in <module>
    freezer.generateCode(basename, compileToExe = compileToExe)
  File "direct/showutil/FreezeTool.py", line 1329, in generateCode
    compileFunc(filename, basename)
  File "direct/showutil/FreezeTool.py", line 210, in compileDll
    raise StandardError, 'failed to compile %s.' % basename
StandardError: failed to compile GameData.
Done building the client.

toontownstartdist is the py file that starts the game
its in toontown/toonbase in the directory

when i use . instead of / i get this

IOError: [Errno 2] No such file or directory: 'toontown.toonbase.ToontownStartDist'

Yeah, FreezeTool is having issues with the / in your module names, you should indeed use “.” however I don’t know how to solve that other issue you are having.

why cant it find toontown.toonbase.ToontownStartDist if its in the current directory?

Well, is there an init.py at each level of the hierarchy?

no?
whats supposed to go in there? nothing?

ok i put the int file like u said in every folder still same error

man i hate this u sure u dont know what else i should do?