Again with 'symbol not found' on Leopard...

6 views
Skip to first unread message

radioflyer

unread,
Jan 9, 2009, 12:11:30 PM1/9/09
to modwsgi
I've been trying to get mod_wsgi(2.3) and/or mod_python working on
Leopard 10.5.6. I'm using svn checkouts of both modules. I'm using
Python 2.6.1.

With the exact same setup on both machines, I'm succeeding on my
MacBookPro(intel) and failing in my G5 Tower(ppc)

Here's the config test error on the ppc machine:
/private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/
mod_wsgi.so into server: dlopen(/usr/libexec/apache2/mod_wsgi.so, 10):
Symbol not found: _PyArg_ParseTuple
Referenced from: /usr/libexec/apache2/mod_wsgi.so
Expected in: dynamic lookup

httpd.conf line:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so

and:
Homeboy:~ dan$ file /usr/libexec/apache2/mod_wsgi.so
/usr/libexec/apache2/mod_wsgi.so: Mach-O universal binary with 4
architectures
/usr/libexec/apache2/mod_wsgi.so (for architecture ppc7400): Mach-O
bundle ppc
/usr/libexec/apache2/mod_wsgi.so (for architecture ppc64): Mach-O 64-
bit bundle ppc64
/usr/libexec/apache2/mod_wsgi.so (for architecture i386): Mach-O
bundle i386
/usr/libexec/apache2/mod_wsgi.so (for architecture x86_64): Mach-O 64-
bit bundle x86_64

The output above is exactly the same when I am trying mod_python.

Here's configure output:
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.9
checking for python... /Library/Frameworks/Python.framework/Versions/
Current/bin/python
configure: creating ./config.status
config.status: creating Makefile


Here's make:
/usr/sbin/apxs -c -I/Library/Frameworks/Python.framework/Versions/2.6/
include/python2.6 -DNDEBUG -Wc,'-arch ppc7400' -Wc,'-arch ppc64' -
Wc,'-arch i386' -Wc,'-arch x86_64' mod_wsgi.c -arch ppc7400 -arch
ppc64 -arch i386 -arch x86_64 -Wl,-F/Library/Frameworks -framework
Python -u _PyMac_Error -ldl
/usr/share/apr-1/build-1/libtool --silent --mode=compile gcc -
DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/usr/include/
apache2 -I/usr/include/apr-1 -I/usr/include/apr-1 -arch ppc7400 -
arch ppc64 -arch i386 -arch x86_64 -I/Library/Frameworks/
Python.framework/Versions/2.6/include/python2.6 -DNDEBUG -c -o
mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
/usr/share/apr-1/build-1/libtool --silent --mode=link gcc -o
mod_wsgi.la -rpath /usr/libexec/apache2 -module -avoid-version
mod_wsgi.lo -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -Wl,-F/
Library/Frameworks -framework Python -u _PyMac_Error -ldl
ld: warning in /Library/Frameworks/Python.framework/Python, missing
required architecture x86_64 in file
ld: warning in /Library/Frameworks/Python.framework/Python, missing
required architecture ppc64 in file

The binary seems to have the correct architectures when I run 'file'
on it, but make shows a warning in the last line that looks ominous.

Any solution obvious?

Graham Dumpleton

unread,
Jan 9, 2009, 5:00:19 PM1/9/09
to mod...@googlegroups.com
2009/1/10 radioflyer <solid...@gmail.com>:

Did you install this Python version yourself, or are you using MacPorts Python?

Graham

radioflyer

unread,
Jan 9, 2009, 5:39:47 PM1/9/09
to modwsgi


On Jan 9, 5:00 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> 2009/1/10 radioflyer <solidet...@gmail.com>:
Hi Graham,

This is the package installer from the Python site. I got it here:
http://www.python.org/download/releases/2.6.
It installs in this path: /Library/Frameworks/Python.framework/
Versions/2.6
I used the same installer for both of my machines. As I mentioned, all
is well on my intel mac but no joy on my ppc G5. My goal is to get
mod_wsgi working on a ppc running Leopard Server at my school so I can
deploy a Django app.

Graham Dumpleton

unread,
Jan 9, 2009, 5:46:20 PM1/9/09
to mod...@googlegroups.com
2009/1/10 radioflyer <solid...@gmail.com>:

Can you send output from running:

file /Library/Frameworks/Python.framework/Python

The above to me indicates that that Python framework installation does
not actually have all architectures compiled into it.

Graham

radioflyer

unread,
Jan 9, 2009, 6:10:24 PM1/9/09
to modwsgi


On Jan 9, 5:46 pm, Graham Dumpleton <graham.dumple...@gmail.com>
I get this:
Homeboy:~ dan$ file /Library/Frameworks/Python.framework/Python
/Library/Frameworks/Python.framework/Python: Mach-O universal binary
with 2 architectures
/Library/Frameworks/Python.framework/Python (for architecture ppc):
Mach-O dynamically linked shared library ppc
/Library/Frameworks/Python.framework/Python (for architecture i386):
Mach-O dynamically linked shared library i386

Dan Jewett

Graham Dumpleton

unread,
Jan 9, 2009, 6:24:44 PM1/9/09
to mod...@googlegroups.com
2009/1/10 radioflyer <solid...@gmail.com>:

If that installer is officially supplied by PSF, then a bug should be
lodged then at bugs.python.org over the fact that they are
distributing an installer which will not work on 64 bit MacOS X
platforms where framework is embedded into a 64 bit application such
as the version of Apache supplied by Apple. Thus, not usable with
mod_python or mod_wsgi.

What it looks like you will need to do is install Python 2.6 from
source code. I believe the configure options should be:

./configure --prefix=/usr/local/python-2.6
--enable-framework=/usr/local/python-2.6/frameworks
--enable-universalsdk=/ MACOSX_DEPLOYMENT_TARGET=10.5
--with-universal-archs=all

The only other option you have is to force Apache to run as 32 bit
instead of 64 bit. For that, see documentation and comments in:

http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX

Graham

Graham Dumpleton

unread,
Jan 9, 2009, 6:42:23 PM1/9/09
to mod...@googlegroups.com
2009/1/10 Graham Dumpleton <graham.d...@gmail.com>:

BTW, you might just be better off installing your own copy of Apache
from source. This will install as 32 bit and not 64 bit and so that
Python 2.6 version will then work fine.

The benefits of running 32 bit are that you have less problems with
third party C extension modules and you don't have to perform hacks to
also get them installed with 64 bit architecture objects. The Apple
Python version understand extra environment variables which will force
Python extensions to install with all architectures, but the PSF
version probably doesn't and so it would be necessary to hack
makefiles/setup.py files to add in special arch flags.

Graham

radioflyer

unread,
Jan 9, 2009, 6:58:09 PM1/9/09
to modwsgi


On Jan 9, 6:42 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> 2009/1/10 Graham Dumpleton <graham.dumple...@gmail.com>:
Thanks so much for your help! This will work for my own machines. I
was hoping to be able to use the admin interface in Leopard Server to
manage Apache to some extent, and I think I will lose that if I
compile from source. I'll have to investigate that.
You've gotten me moving again though. Thanks again.

Dan J.

Graham Dumpleton

unread,
Jan 9, 2009, 7:04:59 PM1/9/09
to mod...@googlegroups.com
2009/1/10 radioflyer <solid...@gmail.com>:

First off then, just try what was in comment at end of that wiki page
I emailed. Quoting it here.

"""I was able to force apache on leopard to run in 32-bit mode as follows.

in /System/Library/LaunchDaemons/org.apache.httpd.plist add these
three arguments the start of the <ProgramArguments> array:

<string>/usr/bin/arch</string> <string>-arch</string> <string>i386</string>
the resulting apache command line looks like this:

/usr/bin/arch -arch i386 /usr/sbin/httpd -D FOREGROUND"""

Just be aware that on OS updates, this plist file is likely to be
replaced if Apache was changed.

Graham

Dan Jewett

unread,
Jan 10, 2009, 8:20:57 AM1/10/09
to modwsgi


On Jan 9, 7:04 pm, Graham Dumpleton <graham.dumple...@gmail.com>
Following
I decided to start by seeing if building Python from source would make
a difference. After a couple tries I got it installed using:
./configure
--enable-framework=/Library/Frameworks
--enable-universalsdk=/ MACOSX_DEPLOYMENT_TARGET=10.5
--with-universal-archs=all
This put everything in the same place as the Python installer package
and gave me a working Python2.6.1

This appears to have fixed things so that both mod_python and mod_wsgi
install and run properly. So, for now, no need to build or thin
Apache. Next step is to learn how to get my Django apps to use
mod_wsgi.

Thanks again for all your help and patience with this.
Regards,
Dan J.

Dan Jewett

unread,
Jan 10, 2009, 8:22:57 AM1/10/09
to modwsgi
Meant to say 'following up'
Reply all
Reply to author
Forward
0 new messages