user2750495
user2750495

Reputation: 49

New error trying to compile pygame to exe

I have created a small game for my little boy using Python 3.4 and Pygame in Windows 7. It also works in Python 2.X, with some minor bugs. Then I tried to create an .exe file using py2exe. I prepared a setup.py file copying the source I found at pygame2exe wiki (http://www.pygame.org/wiki/Pygame2exe?parent=CookBook) also trying to use the suggestions I found in other questions here and in python-forum. What I obtained was the following error:

C:\Python34>python setup.py install

Traceback (most recent call last):

File "setup.py", line 5, in

origIsSystemDLL = py2exe.build_exe.isSystemDLL # save the orginal before we edit it

AttributeError: 'module' object has no attribute 'build_exe'

I have read all other posts on stackoverflow on pygame and exe but I haven’t found anything on this type of error on the web, is there anybody that can help me?

PS for those who prefer cx_freeze, I have tried it too, finding different problems and I will prepare soon another question on it

To give you more details, I am adding this new lines:

And the first lines in the cmd are about 16 missing modules

I have tried in all cases to use as font: None, "Arial", "FreeSansBold.ttf"

Upvotes: 1

Views: 1522

Answers (1)

Tyler Temp
Tyler Temp

Reputation: 773

Just import py2exe.build_exe again will work

>>> import py2exe
>>> py2exe.build_exe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'build_exe'
>>> import py2exe.build_exe
>>> py2exe.build_exe
<module 'py2exe.build_exe' from 'C:\\Python34\\lib\\site-packages\\py2exe\\build_exe.py'>

Upvotes: 2

Related Questions