<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 22, 2009, at 12:00 PM, <a href="mailto:pythonmac-sig-request@python.org">pythonmac-sig-request@python.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br>In article &lt;<a href="mailto:DEF20F43-12BB-4397-9214-8C6A292AF37E@raeder.dk">DEF20F43-12BB-4397-9214-8C6A292AF37E@raeder.dk</a>>,<br>Lars Clausen &lt;<a href="mailto:lars@raeder.dk">lars@raeder.dk</a>> wrote:<br><blockquote type="cite">I've been trying to get mod_python and mysql to work on my Intel &nbsp;<br></blockquote><blockquote type="cite">MacBook Leopard, but with very little luck. [...]<br></blockquote><br>What about the MySQL library itself, i.e. libmysqlclient? &nbsp;Do you have a<span class="Apple-converted-space">&nbsp;</span><br>64-bit version of it? &nbsp;The standard distribution from MySQL is not<span class="Apple-converted-space">&nbsp;</span><br>4-way, (and, for 5.1.30 at least, it's broken for 2-way:<span class="Apple-converted-space">&nbsp;</span><br>&lt;<a href="http://bugs.mysql.com/bug.php?id=41940">http://bugs.mysql.com/bug.php?id=41940</a>>).<br></span></blockquote><div><br></div><div><div>Hedwig:local larsrc$ ls -ld /usr/local/mysql*</div><div>lrwxr-xr-x &nbsp; 1 root &nbsp;wheel &nbsp; 27 Feb 19 20:26 /usr/local/mysql -> mysql-5.0.77-osx10.5-x86_64</div><div><div>Hedwig:Sources larsrc$ file /usr/local/mysql-5.0.77-osx10.5-x86_64/lib/libmysqlclient_r.15.0.0.dylib</div><div>/usr/local/mysql-5.0.77-osx10.5-x86_64/lib/libmysqlclient_r.15.0.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64</div><div><br></div></div><div>However, importing MySQLdb in python directly shows something interesting:</div><div><br></div><div><div>>>> import MySQLdb</div><div>Traceback (most recent call last):</div><div>&nbsp;&nbsp;File "&lt;stdin>", line 1, in &lt;module></div><div>&nbsp;&nbsp;File "build/bdist.macosx-10.5-universal/egg/MySQLdb/__init__.py", line 19, in &lt;module></div><div>&nbsp;&nbsp;File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 7, in &lt;module></div><div>&nbsp;&nbsp;File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 6, in __bootstrap__</div><div>ImportError: dlopen(/Users/larsrc/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5-universal.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/libmysqlclient_r.16.dylib</div><div>&nbsp;&nbsp;Referenced from: /Users/larsrc/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5-universal.egg-tmp/_mysql.so</div><div>&nbsp;&nbsp;Reason: image not found</div><div><br></div><div>It tries to fine the .16 version, but the 64-bit mysql has the .15 version:</div><div><br></div><div><div>Hedwig:local larsrc$ locate libmysqlclient_r | grep .0.0</div><div>/usr/local/mysql-5.0.77-osx10.5-x86_64/lib/libmysqlclient_r.15.0.0.dylib</div><div>/usr/local/mysql-5.1.31-osx10.5-x86/lib/libmysqlclient_r.16.0.0.dylib</div><div><br></div><div>Linking /usr/local/mysql/lib/mysql and recompiling MySQLdb from fresh sources gave an egg that looks for the .15 version, but now it is back to the 'does not define init function'. No luck on that.</div><div><br></div><div><div>>>> import MySQLdb</div><div>Traceback (most recent call last):</div><div>&nbsp;&nbsp;File "&lt;stdin>", line 1, in &lt;module></div><div>&nbsp;&nbsp;File "build/bdist.macosx-10.5-universal/egg/MySQLdb/__init__.py", line 19, in &lt;module></div><div>&nbsp;&nbsp;File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 7, in &lt;module></div><div>&nbsp;&nbsp;File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 6, in __bootstrap__</div><div>ImportError: dynamic module does not define init function (init_mysql)</div><div><br></div><div>I have cleared out my old eggs and checked that the egg used here is 64-bit.</div></div><div><br></div></div></div></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite">Any ideas also why there is no 64-bit installation of Python for Mac? &nbsp;&nbsp;<br></blockquote><blockquote type="cite">Given the presence of fat binaries, it seems like it would be a &nbsp;<br></blockquote><blockquote type="cite">trivial task to have it.<br></blockquote><br>The support for 4-way universal builds in python is relatively new. &nbsp;<br>There has been some discussion recently on the python-dev list about<span class="Apple-converted-space">&nbsp;</span><br>providing "official" 4-way installers for OS X. &nbsp;This will probably get<span class="Apple-converted-space">&nbsp;</span><br>discussed more at the upcoming PyCon.<br></span></blockquote></div><br><div>I hope so. All this grief has had me casting about for another language to do really simple MySQL-to-JSON web services, but I have found nothing that does it as well as Python and Publisher.</div><div><br></div><div>-Lars</div><div><br></div></body></html>