I had a the same symptom when getting Mac OS X 10.4 (comes with Python
2.3) + Python 2.4.3 + mod_python 3.3.1 + apache 2.2.6 going (and in
fact, got help from Graham).  I ended up having to explicitly point to
the right Python framework in my LD_FLAGS line:

LDFLAGS= -Wl,-F/Library/Frameworks  -u _PyMac_Error /Library/
Frameworks/Python.framework/Versions/2.4/Python   -arch ppc -arch i386
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g

and then mod_python finally functioned.

Both in that effort and in some previous attempts to configure my
Python, I ended up avoiding MacPorts entirely.  It's a good concept
but just wasn't standard enough or up-to-date enough.  Also, I try to
stick to Framework installs of Python whereever they come from...

Good luck!

Leo


On Oct 20, 10:39 pm, Ulf Kronman <[EMAIL PROTECTED]> wrote:
> Hi Graham,
> thanks for your answer. Here some replies to your comments.
>
> > A few quick comments, although you may have so mucked up your
> > installations you might be better reinstalling everything, include the
> > OS from scratch. :-)
>
> Uh-uh. So this implies that there may be some settings tucked away in
> some place where I can't get to? But it seems as if both installation
> scripts for mod_python and psycopg2 can find and read this faulty
> setting, since they both put their packages in the funny python2.5/
> site-packages/ beneath my python2.4 path.
>
> > 1. Why are you using Apache 2.1. The Apache 2.1 stream was a
> > developmental version stream, it should not be used for production
> > use. You should use either Apache 2.0.X or Apac 2.2.X streams.
>
> Sorry for giving you the wrong Apache version. I checked with MacPorts
> and I am in fact running Apache 2.2.6 and it was this version I
> pointed at while compiling the mod_python.
>
> > 2. When building mod_python, you should use --with-python option to
> > indicate an alternate version of Python to use.
>
> Yes, I did point at my Python 2.4. Here is the config command I used:
> ./configure --with-apxs=/opt/local/apache2/bin/apxs --with-python=/
> Library/Frameworks/Python.framework/Versions/2.4/bin/python
>
> When I did my trials with Python 2.5, I also pointed at that version
> in the compilation, but still got a mod_python that said it was
> compiled for running Python 2.4 as a result.
>
> > 3. Often with MacPorts versions of Python, when building mod_python
> > you must manually edit the src/Makefile to insert additional linker
> > option into LDFLAGS to indicate where the Python framework libraries
> > are for the version of Python being used. For example, something like:
>
> >   LDFLAGS = -Wl,-F/opt/local/Library/Frameworks ....
>
> OK, thanks. I saw a note about that somewhere, and I used it while
> trying with Python 2.5. I'll have a check if this points the wrong way
> for my Python 2.4 compilation. Right now it looks like this:
> LDFLAGS= -Wl,-framework,Python  -u _PyMac_Error $(PYTHONFRAMEWORKDIR)/
> Versions/$(VERSION)/$(PYTHONFRAMEWORK) ...
>
> Do you think I should replace the -Wl,-framework,Python part with:
> -Wl,-F/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
> site-
> packages/   ?
>
> > 4. When running Apache with that mod_python version, the PATH of the
> > user that Apache runs as must find first the version of the 'python'
> > executable you specified to the --with-python option before any other
> > versions of Python. This can be done by setting the PATH environment
> > variable appropriately in the 'envvars' file in the same directory as
> > the Apache httpd program executable.
>
> Aha. So would that be like an ordinary $PATH setting in my
> bash .profile?:
> export PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:
> ${PATH}"
>
> The thing is that I right now have a working environment, but I feel a
> bit nervous about the fact that packages install in the wrong
> directory out of my control.
>
> Sooner or later, I also have to go up to Python 2.5 for my scripting,
> since I need that version for some unicode-related hacks, due to the
> lack of unicode handling in the CSV package I use for loading my data.
> Before this havoc, I was running python 2.5 for my scripts and python
> 2.4 for the web server (without knowing it). When I install python
> 2.5, do you think I should use the MacPorts version or the DMG
> version?
>
> Thanks for your help,
> Ulf


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to