Poom1997
Poom1997

Reputation: 47

How to build Python 3.4.3 source code with pygame to exe?

Hello how do i build python 3.4.3 source codes with the Pygame library to an exe file (stand-alone) ? (py2exe, doesn't work.) any suggestions? Thank You

Upvotes: 0

Views: 268

Answers (1)

Christoph W.
Christoph W.

Reputation: 1024

Regarding to your comment it seems that you have a problem with your setup. You have to tell py2exe what to include.

There is a useful explanation how to get a standalone exe and how to manage includes: http://pythontips.com/2014/03/03/using-py2exe-the-right-way/

The overall example in this site looks like follows:

from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

DATA=[('imageformats',['C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qjpeg4.dll',
'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qgif4.dll',
'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qico4.dll',
'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qmng4.dll',
'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qsvg4.dll',
'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qtiff4.dll'
])]

setup(
    options = {'py2exe': {'bundle_files': 1, 'compressed': True,"includes":["sip"]}},
    windows = [{'script': "main.py"}],
    zipfile = None,
    data_files = DATA,
)

and you have to call

python setup.py py2exe

to get your standalone exe.

Upvotes: 1

Related Questions