Adding _view to the imports list fixed it. Thank you very much for a swift
answer.

@Zack
That should work, since I'm doing something similar.

Op 6 januari 2012 03:06 schreef Zack Baker <zbaker1...@gmail.com> het
volgende:

> Ok so I want to create an executable but one of my files is basically
> import game and then game.play(). Can I execute the file that has like 2
> lines or should I put everything into one file and build and execute that.
> Btw I'm on a Mac with python 2.7 do which 'compiler' should I use? The
> Build Applet tool that comes with it doesn't seem to work
>
> -Zack
>
>
> On Jan 5, 2012, at 7:31 PM, Lenard Lindstrom <le...@telus.net> wrote:
>
> > Hi,
> >
> > On 05/01/12 02:16 PM, Nick Arnoeyts wrote:
> >> Hey everyone
> >>
> >> I'm trying to get to know cx_freeze as an alternative to py2exe but
> I've run into some problems. There don't seem to be any errors in creating
> the exe, however when running the exe there are complaints about missing
> modules and DLL Load Errors (see below for the error message).
> >>
> >> I am using Python 2.7 (32-bit) on Windows 7 SP1 (64-bit). Tell me if
> there is anything else I have to post and I will do my best.
> >>
> >> Thanks in advance for your help.
> >>
> >> ------------------------------
> >>
> >>
> D:\home\Dropbox\code\eclipse-workspace\TestGame01\build\exe.win32-2.7>main
> >> main:1: RuntimeWarning: import display: No module named _view
> >> (ImportError: No module named _view)
> >> main:1: RuntimeWarning: import draw: No module named _view
> >> (ImportError: No module named _view)
> >> main:1: RuntimeWarning: import image: No module named _view
> >> (ImportError: No module named _view)
> >> main:1: RuntimeWarning: import pixelcopy: No module named _view
> >> (ImportError: No module named _view)
> >> main:1: RuntimeWarning: import transform: No module named _view
> >> (ImportError: No module named _view)
> >> main:10: RuntimeWarning: use font: DLL load failed: %1 is not a valid
> Win32 appl
> >> ication.
> >> (ImportError: DLL load failed: %1 is not a valid Win32 application.)
> >> Traceback (most recent call last):
> >>  File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py",
> line 27
> >> , in <module>
> >>    exec code in m.__dict__
> >>  File "main.py", line 10, in <module>
> >>  File "C:\Python27\lib\site-packages\pygame\__init__.py", line 70, in
> __getattr
> >> __
> >>    raise NotImplementedError(MissingPygameModule)
> >> NotImplementedError: font module not available
> >> (ImportError: DLL load failed: %1 is not a valid Win32 application.)
> > Oops, I better add a token _view import to the Pygame package
> __init__.py.
> >
> > In lib\__init__.py, near the bottom, is a "def package_imports():" with
> a bunch of import statements in the body. Add an import "pygame._view" to
> the end of the list. This should be picked up by cx_freeze and get _view
> included in the package. I will fix this in the repository soon.
> >
> > Module _view adds a wrapper class that exposes Surface data with a NumPy
> style array interface. It is used by surfarray.
> >
> > Lenard Lindstrom
> >
>

Reply via email to