Can't import pygame.image

Graham Ashton graz at mindless.com
Mon Jan 7 19:39:20 EST 2002


I've got problems installing pygame 1.3 on Debian 2.2. When I try and
import pygame.image (according to the docs in fullinstall.txt) I get an
import error, as follows:

  Python 2.1 (#8, Aug 22 2001, 16:46:14) 
  [GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2
  Type "copyright", "credits" or "license" for more information.
  >>> import pygame
  >>> import pygame.image
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  ImportError: /usr/local/lib/python2.1/site-packages/pygame/rwobject.so:
    undefined symbol: SDL_RWFromFP

I've built SDL 1.2.2 from source, and SDL_image 1.2.1. Both are installed.
The pygame/image.so file is compiled and copied into site-packages during
installation, but SDL_RWFromFP doesn't seem to be linked into rwobject.so
properly. Am I doing something wrong here? I've not passed any nutty
options to any configure scripts either.

SDL_RWFromFP is even defined in my /usr/local/lib/libSDL.so;

  $ strings /usr/local/lib/libSDL.so | grep SDL_RWFrom
  SDL_RWFromFile
  SDL_RWFromFP
  SDL_RWFromMem

My pygame Setup file contains the following (after distutils has done
it's guessing to determine what's available):

  SDL = -I/usr/local/include/SDL -L/usr/local/lib -I/usr/local/include \
   -I/usr/local/include/SDL -D_REENTRANT -L/usr/local/lib -lSDL \
   -lpthread -lSDL
  # snip (line breaks above also added by me)
  IMAGE = -I/usr/local/include/SDL -L/usr/local/lib  -lSDL_image
  # snip
  imageext src/imageext.c $(SDL) $(IMAGE)

It all looks fine to me, but is starting to test my understanding of how
this should really work.

Help! Thanks.

--
Graham



More information about the Python-list mailing list