[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame-ctypes installation [was: Sound to Light]



Luke Paireepinart wrote:

Alex - I'm having trouble with your pygame-ctypes.
First off - it installs into lib/site-packages/pygame? doesn't this mean it conflicts with regular pygame?

Yes it does -- I wouldn't recommend installing it (as there's nothing to compile, it will run from it's own directory.. just add it to PYTHONPATH).


(I don't have regular pygame installed right now)

That's lucky :-) Just delete the lib/site-packages/pygame and lib/site-packages/SDL directories before you install the "real" pygame.



Second - I installed pygame-ctypes using 'pygame setup.py install'
The original 'pygame-ctypes-0.07' directory is on my desktop, and it copied files into
'C:/python24/Lib/site-packages/pygame' and 'C:/python24/Lib/site-packages/SDL'


Seems reasonable, though I'm not sure exactly how windows lays out files.

Whenever I ran the example programs in 'desktop/pygame-ctypes-0.07/test' I saw this error message pop up and disappear, so I
went into a cmd prompt and ran it so I could see the error message, and it was
File "C:\Documents and Settings\Rabidpoobear\Desktop\pygame-ctypes-0.07\test\checkkeys.py", line 14, in ?
from SDL import *
File "C:\python24\Lib\site-packages\SDL\__init__.py", line 30, in ?
import SDL.dll
File "C:\python24\Lib\site-packages\SDL\dll.py", line 217, in ?
_dll = SDL_DLL('SDL','SDL_Linked_Version')
File "C:\python24\Lib\site-packages\SDL\dll.py", line 42, in __init__
self._dll = getattr(cdll, find_library(library_name))
TypeError: getattr(): attribute name must be string


Now that I think about it more, I'm guessing that find_library(library_name) is returning None instead
of the library location because I don't have SDL installed.

Yep! Also I doubt it will work on Windows at the moment. Look for a newer release over this weekend that fixes this problem.


So what I'm wondering is, if I just install SDL and SDL_image, mixer, ttf, and sound, using the
windows installers, is it going to add it to the path for me so pygame-ctypes will find it?

So long as all these .dll's end up somewhere normal like c:\windows\system32, they'll be found just fine.



Also, I know it should be self-explanatory for a programmer such as myself that a
ctypes module that wraps a C dll would need the C dll to be present somewhere,
but obviously I was confused long enough to start writing an e-mail to you.
Perhaps it's because I just woke up ;)
Anyway, maybe you should put a 'Don't forget to install SDL and ctypes!' on the
front page.

That's an excellent idea, thanks. The other critical dependency is of course ctypes, which *must* be 1.0.0.


I'll have something a little more Windows friendly for you later today.

Alex.