[Image-SIG] undefined symbol: Py_InitModule4: more information

Edward C. Jones edcjones@erols.com
Wed, 27 Jun 2001 14:58:16 -0400


I have 3 copies of Python on my system: the Python 1.5 that 
RedHat uses in the /usr tree, Python 2.1, also in the /usr tree, 
and Python 2.1 compiled with the "--with-pydebug" switch. This 
latter copy is in the /usr/local directory tree. If I type 
"python", I get /usr/bin/python because of a "ln -s".

I am trying to install PIL with the Python debugging stuff 
included. What am I doing wrong?

The make process in libImaging does not appear to depend on 
Python in any way.

The first try at "make -f Makefile.pre.in boot" failed because it 
couldn't find tcl8.0. A change in Setup to "8.3" fixed that.

I made the following assumption: The default settings for 
installing PIL assume Python is in the /usr/local/lib tree. 
Therefore the "--with-pydebug" version of the include files, etc. 
will be found. A second attempt at "make -f Makefile.pre.in boot" 
and "make" worked. I did "PYTHONPATH=.:./PIL ; export PYTHONPATH" 
and then "/usr/local/bin/python2.1". An attempt to "import 
_imaging" gave an error message. Here is the session:

      Python 2.1 (#8, Jun 26 2001, 16:22:28)
      [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
      Type "copyright", "credits" or "license" for more information.
      >>> import _imaging
      Traceback (most recent call last):
        File "<stdin>", line 1, in ?
      ImportError: ./_imaging.so: undefined symbol: Py_InitModule4
      [6981 refs]
      >>>
      [6981 refs]
      [2374 refs]
      Print left references? [ny] n

If I modify /usr/local/src/Imaging-1.1.2/Makefile.pre.in to say

# Installed python binary (used only by boot target)
PYTHON=         /usr/local/bin/python2.1

then I get the error:

      make[1]: Entering directory `/usr/local/src/Imaging-1.1.2'
      make[1]: *** No rule to make target `Print'.  Stop.
      make[1]: Leaving directory `/usr/local/src/Imaging-1.1.2'
      make: *** [boot] Error 2