[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Problems installing to cygwin/w2000



My experience of trying to get Yass source to run on a machine
on which Yass binary runs fine. [ w2k, cygwin, Numerical Python ]
(follows earlier post with problems trying to compile pygame from source
on cygwin/w2k box)


From http://C311a.WH8.TU-Dresden.De/~crashchaos/yass/download.php
downloaded the yass 'full source version'.
Unzipped it to /cygdrive/c/Python21/games, yass subdir was created in
games
cd to ./games/yass
Read instructions and tried, 'python startup.py'
This failed with :
"""
Traceback (most recent call last):
  File "startup.py", line 7, in ?
    import pygame,pygame.image
ImportError: No module named pygame
"""


My pygame tree (from http://www.pygame.org/ftp/pygame-1.1.win32-py2.1.exe)
was in /cygdrive/c/Python21
Perhaps a bit optimistic.
So I found the real Python library directory, which turned out to be
/lib/python2.1/
and linked my pygame tree to it.
ln -s /cygdrive/c/Python21/pygame /lib/python2.1/pygame
Then tried, 'python startup.py'
This failed, but differently - hurrah an 'effect' :
"""
Traceback (most recent call last):
  File "startup.py", line 7, in ?
    import pygame,pygame.image
  File "C:\Python21\pygame\__init__.
    from pygame.base import *
ImportError: No module named base
"""

Right. So pygame itself is found, indeed pygame.image loads ok ;;; wow.
What's the difference between pygame.image and pygame.base then ?
On investigation... there doesn't appear to be one... hmmm?

Ah, not reading error right !
the problem isn't that startup.py can't load pygame.base,
but that pygame.__init__ can't load pygame.base
Presumably __init__.py is being executed because of pygame class (aha...
spot the Python newbie) is being
imported, I seem to remember reading about that in the tutorial.

(short break to re-read that bit of tutorial)

What code is in pygame.__init__.py then ?
well, it contains the code :
"""
from pygame.version import ver

from pygame.base import *
from pygame.surface import *
from pygame.rect import *
from pygame.locals import *
import pygame.cdrom
import pygame.display
import pygame.event
import pygame.key
import pygame.mouse
import pygame.time
import pygame.joystick
"""

and yet, "from pygame.version import ver" isn't failing,
but the pygame.base line is

Oh, wierder and wierder, the pygame.base file is only available as a .pyd
file - not a .py or .pyc file, and inspection
with debugger reveals this is compressed, looks like windows exe, has MZ
file sigature and comments about how it cannot
be run in DOS mode,,, strange

Right... it appears that the pygame install I've got isn't going to work
from cygwin because it's got Python code
which is platform specific within it...
Ah... I wonder if these things aren't python, but are C/C++ (or whatever)
providing classes to Python.

Which would explain the mess.


Perhaps I need a binaries install replacement for
http://www.pygame.org/ftp/pygame-1.1.win32-py2.1.exe which is
what I'm using at present.
I must admit to some confusion over whether to download Unix or Windows
things when using cygwin :-)


OK... I'll send this, in case I'm barking up the wrong tree and rather
than just wait for feedback, I'll download the
nearest Unixy binaries install (well precompiled .o's and libs ?)
replacement for the ./pygame subtree


If I've gone wrong, an early "You've gone wrong" reply would be
appreciated.


Cheers


peter


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org