[Image-SIG] Re: PIL 1.1.4 and Python 2.3 on Mac OS X 10.3?

Fredrik Lundh fredrik at pythonware.com
Thu Nov 6 04:47:24 EST 2003


Bill Janssen wrote:

> I've just upgraded my Mac to 10.3, and I'm trying to install PIL 1.1.4
> under /usr/bin/python, which is now 2.3.  Build seems to go alright.
> But no soap -- I keep getting the following error:
>
>   % /usr/bin/python
>   Python 2.3 (#1, Sep 13 2003, 00:49:11)
>   [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> import Image
>   Fatal Python error: Interpreter not initialized (version mismatch?)
>   Abort
>   %
>
> Anyone know the issue?

Both the Python executable and the extension module (_imaging, in this
case) are linked against the Python library DLL/SO [1].  When you run the
interpreter, it's important that the system uses the same library instance
for both the executable and the extension; if not, you get the above error
message.

Here's what happens:

    1) the system loads the python executable
    2) the python executable is dynamically linked against the Python library
    by the system's runtime loader [1]
    3) the python executable hands control over to the Py_Main function in
    that library, which initializes the library and enters the command loop (or
    runs the script).
    4) when you type the "import" command, code in the Python library locates
    and loads the _imaging module
    5) the runtime loader links the _imaging module against the Python library,
    but this time, it picks up a *different* instance of the library.
    6) the _imaging library calls a function in the Python library, which notices
    that it hasn't been properly initialized, and terminates.

To fix this, look for bogus Python DLL/SOs on the system and Python path.
If that doesn't help, it might be a linking problem; check with the Mac folks
for details.

</F>

1) or whatever they're called on MacOS 10.3.






More information about the Image-SIG mailing list