You are not logged in.
So I put up my first site on web faction a couple weeks ago, went smoothly, after figuring all the necessary changes that needed to be made from using the built-in django server vs the apache production server. I realized that since I have multiple sites I am working on, it would be useful to just setup django + apache on my local machine. Well I am running to some issues. Here is what I did so far:
- installed mysql 5.0.51b (binary OSX 10.5 x86_64) WORKS!
- installed mod_python 3.3.1 (change a few lines as mentioned here "http://blog.wired.com/monkeybites/2007/11/tips-and-tricks.html" to get the x86_64 arch) WORKS! (able to import it via python interpreter)
- installed MySQLdb 1.2.2 (commented out a few lines for it to compile as noted here "http://www.davidcramer.net/code/57/mysqldb-on-leopard.html" DOES NOT WORK
- installed django trunk WORKS!
- setup my apache configuration and everything looks like it is good. but when i navigation to my virtual host i get:
ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/Me/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so, 2): no suitable image found. Did find:
/Users/Me/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so: no matching architecture in universal wrapper
AND in the python interpreter i can't import MySQLdb, its throws this error:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dynamic module does not define init function (init_mysql)
This may or may not be enough to diagnose the problem, but anyone have any ideas? It seems that i followed all the correct directions to make sure everything is x86_64, but its not working. How does webfaction have this all setup?
Thanks.
thedevel
Offline
since the support for python 2.4 is a bit better, i am assuming webfaction has mysqldb 1.2.1_p2 installed that supports python 2.4 rather than the newest one? should downgrade to that? i thought the purpose of the release of mysqldb 1.2.2 was to support py 2.5.
Offline
thedevel wrote:
since the support for python 2.4 is a bit better, i am assuming webfaction has mysqldb 1.2.1_p2 installed that supports python 2.4 rather than the newest one? should downgrade to that? i thought the purpose of the release of mysqldb 1.2.2 was to support py 2.5.
Our Python2.4 uses MySQLdb 1.2.2:
[seanf@web33 ~]$ python2.4
Python 2.4.3 (#1, Mar 14 2007, 18:51:08)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> MySQLdb.__version__
'1.2.2'
Our Python 2.5 also uses 1.2.2
Regarding MySQLdb 1.2.2 on Leopard, I actually did this myself two days ago using the workaround at http://www.davidcramer.net/code/57/mysq … opard.html and did not have any problems. I suggest you try the following:
1. Delete /Users/Me/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp
2. Download the MySQLdb tarball from http://sourceforge.net/project/showfile … p_id=22307
3. Unpack the tarball, make the changes shown at http://www.davidcramer.net/code/57/mysq … pard.html, then build with "python setup.py build && python setup.py install"
Hope that helps!
Offline
yea that is exactly what i have been doing, tried it again and same error... seanf you mind sharing how you happened to setup mod_python? did you built mysql from source?
Offline
i keep getting this error..
>>> import MySQLdb Traceback (most recent call last): File "<stdin>", line 1, in <module> File "build/bdist.macosx-10.5-i386/egg/MySQLdb/__init__.py", line 19, in <module> File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in <module> File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dynamic module does not define init function (init_mysql)
i have found numerous ways to match up the arch (so mysqldb is x86_64) to recompile the _mysql.so after running: python setup.py build, but i still get this error.
Offline
found a workaround for the time being until compilation of all necessary parts are x86_64. dropped apache to run a 32 bit process, which allowed for everything else to be 32 bit. the link to that is here.. called "Thinning the Apache Executable" http://code.google.com/p/modwsgi/wiki/I … onOnMacOSX
Offline
thedevel wrote:
yea that is exactly what i have been doing, tried it again and same error... seanf you mind sharing how you happened to setup mod_python? did you built mysql from source?
I wasn't working with mod_python, just working with Django's dev server.
I installed MySQL from the official Mac release (5.0.51)
Last edited by seanf (2008-05-12 19:21:20)
Offline