Try

http://thadeusb.com/weblog/2009/4/15/pygame_font_and_py2exe

--
Thadeus




On Thu, Oct 28, 2010 at 6:23 PM, Zachary Uram <netrek@gmail.com> wrote:
Trying to build a pygame app and running into an error.

I have installed: python-2.6.amd64.msi, pygame-1.9.1.win32-py2.6.msi,
and py2exe-0.6.9.win64-py2.6.amd64.exe
Running Windows 7 Ultimate (x64)

Here is my setup program name pygame2exe.py:

##################################################
from distutils.core import setup
import py2exe, pygame
import glob, shutil

setup(windows=["__init__.py"],
name='Netrek Pygame',
version='0.3.1',
description='Netrek Pygame Client',
author='James Cameron',
author_email='',
url='www.netrek.org',
py_modules=['__init__','cache','cap','client','constants','mercenary','meta','mis','motd','options','rcd','repair','test-cairo','test-keys','util']
)

shutil.copytree('data', 'dist/data')
shutil.copyfile('freesansbold.ttf', 'dist/freesansbold.ttf')
##################################################

I've never done this before so I'd like some feeback. __init__.py is
the main program file and the other python files are cache.py, cap.py,
etc. so I listed them all under "py_modules=" was that correct?

Anyways here is what happens when I try to build:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>cd C:\Users\Administrator\Desktop\python\netrek-client-py
game-0.6\netrek

C:\Users\Administrator\Desktop\python\netrek-client-pygame-0.6\netrek>dir
 Volume in drive C has no label.
 Volume Serial Number is 26DD-5AA7

 Directory of C:\Users\Administrator\Desktop\python\netrek-client-pygame-0.6\net
rek

10/28/2010  06:25 PM    <DIR>          .
10/28/2010  06:25 PM    <DIR>          ..
03/27/2010  10:55 PM             6,101 cache.py
05/17/2009  09:56 PM             3,587 cap.py
03/27/2010  11:21 PM            10,585 client.py
10/12/2010  03:11 AM             6,691 constants.py
06/30/2008  10:39 PM            98,600 freesansbold.ttf
03/27/2010  06:43 AM             2,777 mercenary.py
12/15/2009  02:49 AM             4,423 meta.py
09/19/2010  07:57 AM             1,046 mis.py
09/20/2010  09:33 PM               692 motd.py
02/27/2010  07:18 PM             3,414 options.py
06/30/2008  10:39 PM             1,078 pygame.ico
10/28/2010  06:25 PM               514 pygame2exe.py
10/28/2010  06:21 PM             5,647 pygame2exe2.py
03/31/2009  04:52 AM             7,690 rcd.py
07/07/2008  03:11 AM               465 repair.py
07/09/2008  03:34 AM               713 test-cairo.py
03/24/2010  10:39 PM               374 test-keys.py
02/23/2010  09:36 PM             1,229 util.py
10/12/2010  03:16 AM           180,674 __init__.py
             19 File(s)        336,300 bytes
              2 Dir(s)  10,690,691,072 bytes free

C:\Users\Administrator\Desktop\python\netrek-client-pygame-0.6\netrek>python
Python 2.6 (r26:66721, Oct  2 2008, 11:06:43) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> (exit)
Use exit() or Ctrl-Z plus Return to exit
>>> exit()

C:\Users\Administrator\Desktop\python\netrek-client-pygame-0.6\netrek>python
pygame2exe.py py2exe
C:\Python26\lib\site-packages\py2exe\build_exe.py:16:
DeprecationWarning: the sets module is deprecated
 import sets
Traceback (most recent call last):
 File "pygame2exe.py", line 2, in <module>
   import py2exe, pygame
 File "C:\Python26\lib\site-packages\pygame\__init__.py", line 95, in <module>
   from pygame.base import *
ImportError: DLL load failed: %1 is not a valid Win32 application.

Any help would be greatly appreciated.

Zach

<>< http://www.fidei.org ><>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Py2exe-users mailing list
Py2exe-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/py2exe-users