Jump to content

  • Log In with Google      Sign In   
  • Create Account


python:can not build exe file with png from py2exe


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 28 February 2013 - 09:23 PM

hi

 

i am having trouble creating an exe file from python script using pygame, when i have to include png files.  when i build an exe file without the png file, the exe file run fine. the only problem is when i used pygame and include png files.

 

i hope some one can give me some pointers and point out the errors that i made.

 

note: i import pygame._view, but i still have the _view errors. :)

 

i include the exe log and the setup.py below.  

 

thanks in advance.

 

 

C:\Python\Wormy\dist\wormy.exe:12: RuntimeWarning: import display: No module named _view
(ImportError: No module named _view)
C:\Python\Wormy\dist\wormy.exe:12: RuntimeWarning: import draw: No module named _view
(ImportError: No module named _view)
C:\Python\Wormy\dist\wormy.exe:12: RuntimeWarning: import image: No module named _view
(ImportError: No module named _view)
C:\Python\Wormy\dist\wormy.exe:12: RuntimeWarning: import pixelcopy: No module named _view
(ImportError: No module named _view)
C:\Python\Wormy\dist\wormy.exe:12: RuntimeWarning: import transform: No module named _view
(ImportError: No module named _view)
Traceback (most recent call last):
  File "wormy.py", line 43, in <module>
  File "pygame\__init__.pyc", line 70, in __getattr__
NotImplementedError: image module not available
(ImportError: No module named _view)
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
Traceback (most recent call last):
  File "wormy.py", line 44, in <module>
pygame.error: Couldn't open img/apple.png
 
and the setup.py.
 
'''
Created on Feb 21, 2013
 
    to run this script, type: python setmeup.py py2exe -v
 
@author: rob
'''
from distutils.core import setup
import py2exe, os
import pygame._view
 
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
    if os.path.basename(pathname).lower() in ("sdl_ttf.dll", "libogg-0.dll"):
            return 0
    return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL
 
dfiles = [('.', ['img/splash3.png', 'img/apple.png'])]
setup(windows = [{"script": "wormy.py"}],
      data_files = dfiles,
      author="Robert Tran",
      author_email="tj3robert@gmail.com")
#      data_files=[('img',['apple.png', 'splash3.png'])])
 
print "\n\t terminated."
 

 



Sponsor:

#2 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 28 February 2013 - 10:31 PM

hi

 

i finally got it.

 

bye






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS