[mod_python] Error: Could not import mod_python.apache

Michael S. Fischer michael at dynamine.net
Mon Feb 9 08:57:30 EST 2004


You probably didn't get a response because in your original post, you didn't
tell us the details of your system.  Now we know you're using OS X, but we
still don't know which version.

If you're using Panther (10.3), you don't need a separate Python
installation; the stock Python 2.3 that ships with it will suffice.  Check
the following post for additional information:




----- Original Message ----- 
From: "Dietrich Epp" <dietrich at zdome.net>
To: "Mod Python Users" <mod_python at modpython.org>
Sent: Sunday, February 08, 2004 11:43 PM
Subject: Re: [mod_python] Error: Could not import mod_python.apache

> Hmm... this time I'll try sending the reply to the LIST, as opposed to
> just myself.
> Okay, it's been almost 48 hours and the response has been dead except
> for a single person telling me that they had the same problem.  That's
> cool.  I rewrote the error handling for the section of mod_python that
> failed and got a much more descriptive message.  I replaced the
> occurrences of \n with newlines.  It appears to be cut off by Python at
> (2^9)-1 characters after "ImportError: ".
> [error] mod_python: ImportError: Failure linking new module: : dyld:
> /usr/local/apache/bin/httpd Undefined symbols:
> /usr/local/python/lib/python2.3/lib-dynload/time.so undefined reference
> to _PyArg_Parse expected to be defined in the executable
> /usr/local/python/lib/python2.3/lib-dynload/time.so undefined reference
> to _PyArg_ParseTuple expected to be defined in the executable
> /usr/local/python/lib/python2.3/lib-dynload/time.so undefined reference
> to _PyDict_GetItemString expected to be defined in the executable
> /usr/local/python/lib/pytho
> This leaves me with some questions.
> 0. Why does mod_python call PyErr_Print?  The output goes nowhere, as
> far as I can tell, even if httpd is launched with -X.
> 1. Does this mean that python's dynamically-linked modules only look in
> the linking application namespace to find symbols expected to be found
> in Python?
> 2. Could I fix this by relinking Python with a single level namespace
> (this is specific to Mac OS X)?  This seems to be a bad solution, as I
> don't think the problem is OS X-specific.
> 3. Could I fix this by changing in a more general (i.e.,
> cross-platform) way the method that Python's libraries search for their
> dependencies?  Can this be done without moving Python's core code to a
> dynamic library?
> 4. Have other projects had the same problem when embedding Python in
> dynamically loaded object code?
> 5. Are there even any other projects which embed Python in dynamically
> loaded object code?
> 6. Am I posting on the wrong list?
> On Feb 7, 2004, at 3:21 AM, Dietrich Epp wrote:
> > I've spent a while searching the list archives for a solution to the
> > problem:
> >
> > make_obcallback: could not import mod_python.apache.
> >
> > I'm running Apache 2.0 and mod_python from CVS.  Python is installed
> > in a funny place, /usr/local/python.  According to my research, I have
> > to do something to tell apache/mod_python Python's location.  Is that
> > correct?  How do I do this?  I've seen a decent number of messages on
> > this topic, but very few answers, and none that are definitive.
> >
> > Since I'm doing the tutorial in the docs, I see no need to post my
> > httpd.conf sections here.
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list