On 11 February 2011 00:21, Michael Bartz <[email protected]> wrote: > I will be more specific :). > > The server is a Mac Mini running Mac OS X 10.5.8: > > Model Name: Mac mini > Model Identifier: Macmini2,1 > Processor Name: Intel Core 2 Duo > > I have the 64-bit version of MySQL 5.1 installed as follows: > > mysql-5.1.55-osx10.5-x86_64 > > I downloaded the most recent version of MySQLdb from SourceForge > (MySQL-python-1.2.3). > > I edited the site.cfg to find the local version of MySQL (/usr/local/ > mysql/bin/mysql_config). > > and ran "python setup.py install" discerning no errors except that all > the libraries are labeled i386 (rather than x86_64 or some such).
Confirm what the situation is by running: file _mysql.so Also run: file /usr/local/mysql/lib/libmysqlclient_r.16.dylib Command line Python on Leopard from memory runs as 32 bit so I actually think problem is that _mysql.so is 32 bit but that libmysqlclient_r.16.dylib is actually 64 bit and so why the error. If you use Apple Apache and Apple Python however, as Apache starts as 64 but by default, then Python will also run as 64 bit and so long as _mysql.so is fat and has both 32/64 bit in one file, then the libmysqlclient_r.16.dylib should work under Apache at least. Post the output of the 'file' command for each to confirm and can then suggest what you actually need to do. Graham > I started python and tried to import MySQLdb and got the error message > below. Ignore please the newbie issue of not removing the source > directory. This is where the trail started. From there I have tried > numerous homebrew methods derived from google searching. I make it > the furthest by uploading MacPython 2.6.6 but got stuck and finally > reached out here. > > Python 2.5.1 (r251:54863, Sep 1 2010, 22:03:14) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import MySQLdb > /Library/Python/2.5/site-packages/MySQL_python-1.2.3-py2.5-macosx-10.5- > i386.egg/_mysql.py:3: UserWarning: Module _mysql was already imported > from /Library/Python/2.5/site-packages/MySQL_python-1.2.3-py2.5- > macosx-10.5-i386.egg/_mysql.pyc, but /Users/bartz/MySQL-python-1.2.3 > is being added to sys.path > import sys, pkg_resources, imp > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "MySQLdb/__init__.py", line 19, in <module> > import _mysql > 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: dlopen(/Users/bartz/.python-eggs/MySQL_python-1.2.3-py2.5- > macosx-10.5-i386.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/ > mysql/lib/libmysqlclient_r.16.dylib > Referenced from: /Users/bartz/.python-eggs/MySQL_python-1.2.3-py2.5- > macosx-10.5-i386.egg-tmp/_mysql.so > Reason: no suitable image found. Did find: > /usr/local/mysql/lib/libmysqlclient_r.16.dylib: mach-o, but wrong > architecture >>>> quit > > > > On Feb 9, 8:19 pm, Graham Dumpleton <[email protected]> > wrote: >> On 10 February 2011 04:44, Michael Bartz <[email protected]> wrote: >> >> > Graham: >> >> > Thanks for the reply. I realize that the "solution" is to upgrade to >> > Snow Leopard, but that is not an option currently. >> >> > I certainly may have gotten lost wandering through version levels of >> > the different components. >> >> > I think my problems started when I tried to build the MySQLdb >> > connector with the 32-bit Python. >> >> > Are you saying that the answer to these issues is to create a local >> > build of a 64-bit Python? Is that something already done or do I need >> > to go down that road on my own? >> >> Don't know, as I still can't see that you have clearly described what >> your original problem was. >> >> Was it that MySQLdb wrapper wouldn't compile, or you got some sort of >> error when loading it? If the latter, what error? Or was it that your >> Python wouldn't even load in Apache? >> >> Graham >> >> >> >> > On Feb 8, 7:19 pm, Graham Dumpleton <[email protected]> >> > wrote: >> >> What is the specific MySQLdb problem you are trying to resolve? The >> >> one where its standard build scripts only build it for 32 bit and not >> >> for both 32 bit and 64 bit? In other words, tell us clearly the >> >> original problem you are trying to solve and not what you steps you >> >> are taking to try and solve it and not the problems occurring with >> >> your steps at solving it. For all I can tell, not knowing the exact >> >> original problem, you are going about this all the wrong way. >> >> >> Note that PSF MacPython is 32 bit only and you will not be able to use >> >> it under Apple supplied Apache which will default to running 64 bit if >> >> you have 64 bit CPU. >> >> >> BTW, why can't you upgrade to Snow Leopard. Leopard caused various >> >> problems with linking for MacPython install? >> >> >> Graham >> >> >> On 9 February 2011 02:53, Michael Bartz <[email protected]> wrote: >> >> >> > I seem to keep going around in circles :(. >> >> >> > I have to use MacPython 2.6 so that MySQLdb will compile properly. >> >> > But I can't seem to create a workable mod_wsgi with a Python updated >> >> > from the system version. >> >> >> > The wiki implies that that MacPython will peacefully co-exist with the >> >> > System Python, which is not true. The Apple Python is stored in / >> >> > System/Library/Frameworks and the python.org installer puts the >> >> > upgraded Python (2.6) in /Library/Frameworks/. >> >> >> > The wiki also states the using the WSGI directive to set the Python >> >> > Home cannot span a major version number. So, I built mod_wsgi with >> >> > the updated Python. I inspected the Makefile and it appears to have >> >> > been built properly (according to the wiki). >> >> >> > To "avoid" the Python mismatch error, I tried to set the PythonHome >> >> > with the results as listed in the previous post (the PyExc_Runtime >> >> > error). >> >> >> > I tried another approach as suggested in the wiki to set the ENVVARS. >> >> > I set the PATH to the bin directory of the updated Python (as stated >> >> > above). When I install and then restart Apache, I get the following >> >> > error: >> >> >> > httpd: Syntax error on line 164 of /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: _PyExc_RuntimeError >> >> > \n Referenced from: /usr/libexec/apache2/mod_wsgi.so\n Expected in: >> >> > dynamic lookup\n >> >> >> > On Feb 7, 10:41 pm, Michael Bartz <[email protected]> wrote: >> >> >> I re-read the documents on different Python versions and rebuilt >> >> >> mod_wsgi with the configure directive to point to the system version >> >> >> not the updated version. >> >> >> >> I was able to get the test application to display. >> >> >> >> BUT, does this mean that my Django applications will use the system >> >> >> Python (2.5.1) or the updated one (2.6.6)? >> >> >> >> Also, FYI, I tried setting the WSGIPythonHome directive and I got >> >> >> errors "PyExecRuntime not found" >> >> >> >> On Feb 7, 12:14 pm, Michael Bartz <[email protected]> wrote: >> >> >> >> > I am trying to install Django on a Leopard Mac OS X Server and keep >> >> >> > stumbling on several seemingly common pitfalls. >> >> >> >> > The most recent is the "Python version mismatch" problem. In order >> >> >> > to >> >> >> > clear up the 32-bit, 64-bit MySQL issue with MySQL and MySQLdb, I >> >> >> > installed MacPython 2.6.6 from python.org. >> >> >> >> > I was able to successfully install and use MySQL and Django in >> >> >> > development mode. >> >> >> >> > I am stuck on installing WSGI. I have built mod_wsgi-3.3 with the -- >> >> >> > disable-frameworks and the --with-python directive pointing to the / >> >> >> > Library version of in the updated Python. >> >> >> >> > When I try to start Apache, Apache core dumps and the error log has >> >> >> > the following: >> >> >> >> > [Mon Feb 07 12:01:31 2011] [error] python_init: Python version >> >> >> > mismatch, expected '2.6.6', found '2.5.1'. >> >> >> > [Mon Feb 07 12:01:31 2011] [error] python_init: Python executable >> >> >> > found '/usr/bin/python'. >> >> >> > [Mon Feb 07 12:01:31 2011] [error] python_init: Python path being >> >> >> > used >> >> >> > '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> >> >> > python25.zip:/System/Library/Frameworks/Python.framework/Versions/2.5/ >> >> >> > lib/python2.5/:/System/Library/Frameworks/Python.framework/Versions/ >> >> >> > 2.5/lib/python2.5/plat-darwin:/System/Library/Frameworks/ >> >> >> > Python.framework/Versions/2.5/lib/python2.5/plat-mac:/System/Library/ >> >> >> > Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib- >> >> >> > scriptpackages:/System/Library/Frameworks/Python.framework/Versions/ >> >> >> > 2.5/lib/python2.5/../../Extras/lib/python:/System/Library/Frameworks/ >> >> >> > Python.framework/Versions/2.5/lib/python2.5/lib-tk:/System/Library/ >> >> >> > Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload'. >> >> >> >> > I am left puzzled about where the PYTHONPATH is being set. I have >> >> >> > toyed with the idea of setting the symbolic link in /usr/bin/python >> >> >> > to >> >> >> > the correct one, but I am sure that would cause untold havoc. >> >> >> >> > Can someone give me a pointer in the right direction? >> >> >> >> > Thanks. >> >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups "modwsgi" group. >> >> > To post to this group, send email to [email protected]. >> >> > To unsubscribe from this group, send email to >> >> > [email protected]. >> >> > For more options, visit this group >> >> > athttp://groups.google.com/group/modwsgi?hl=en. >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "modwsgi" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group >> > athttp://groups.google.com/group/modwsgi?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
