MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread crudolph

Hi,

I was able to get django/python running via mod_python under the
apache2 installation under Leopard (MacOS X 10.5). However once I
start to add database support to my project - I get the following
error.

ImproperlyConfigured: Error loading MySQLdb module: dlopen(/tmp/
egg_cache/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so,
2): no suitable image found.  Did find:
/tmp/egg_cache/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/
_mysql.so: no matching architecture in universal wrapper

Anyone have any luck figuring this out?

Thanks,
Chris.

-- Full Error Listing --

MOD_PYTHON ERROR

ProcessId:  28674
Interpreter:'mysite'

ServerName: 'Lepperd.local'
DocumentRoot:   '/Library/WebServer/Documents'

URI:'/webdocs/mysite/'
Location:   '/webdocs/mysite'
Directory:  None
Filename:   '/Library/WebServer/Documents/webdocs/mysite/'
PathInfo:   ''

Phase:  'PythonHandler'
Handler:'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)

  File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1229, in _process_target
result = _execute_target(config, req, object, arg)

  File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1128, in _execute_target
result = object(arg)

  File "/Library/Python/2.5/site-packages/django/core/handlers/
modpython.py", line 177, in handler
return ModPythonHandler()(req)

  File "/Library/Python/2.5/site-packages/django/core/handlers/
modpython.py", line 145, in __call__
self.load_middleware()

  File "/Library/Python/2.5/site-packages/django/core/handlers/
base.py", line 29, in load_middleware
mod = __import__(mw_module, {}, {}, [''])

  File "/Library/Python/2.5/site-packages/django/contrib/sessions/
middleware.py", line 2, in 
from django.contrib.sessions.models import Session

  File "/Library/Python/2.5/site-packages/django/contrib/sessions/
models.py", line 3, in 
from django.db import models

  File "/Library/Python/2.5/site-packages/django/db/__init__.py", line
11, in 
backend = __import__('django.db.backends.%s.base' %
settings.DATABASE_ENGINE, {}, {}, [''])

  File "/Library/Python/2.5/site-packages/django/db/backends/mysql/
base.py", line 12, in 
raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e

ImproperlyConfigured: Error loading MySQLdb module: dlopen(/tmp/
egg_cache/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so,
2): no suitable image found.  Did find:
/tmp/egg_cache/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/
_mysql.so: no matching architecture in universal wrapper


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread crudolph

Yeah - I downloaded from http://sourceforge.net/projects/mysql-python,
unzipped and ran python setup.py build and then install.

Under Leopard (10.5) apache2 is 4-way, so it is running in 64-bit
mode. I haven't been able to figure out how to pass the right
architecture flags through setup.py

cc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-
madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -
DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -pipe -
Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/mysql/
include -I/System/Library/Frameworks/Python.framework/Versions/2.5/
include/python2.5 -c _mysql.c -o build/temp.macosx-10.5-i386-2.5/
_mysql.o -Os -arch i386 -fno-common
gcc -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc -
arch ppc64 -arch x86_64 build/temp.macosx-10.5-i386-2.5/_mysql.o -L/
usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm -o build/
lib.macosx-10.5-i386-2.5/_mysql.so
ld: warning in build/temp.macosx-10.5-i386-2.5/_mysql.o, file is not
of required architecture
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture
ld: warning in build/temp.macosx-10.5-i386-2.5/_mysql.o, file is not
of required architecture
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture
ld: warning in build/temp.macosx-10.5-i386-2.5/_mysql.o, file is not
of required architecture
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---