<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: mysql-python and Snow Leopard</title>
	<atom:link href="http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/feed/" rel="self" type="application/rss+xml" />
	<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/</link>
	<description>This is my blog, there are many others like it but this one is mine.</description>
	<lastBuildDate>Wed, 21 Jul 2010 11:24:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> kcallahan</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-1310</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> kcallahan</dc:creator>
		<pubDate>Wed, 21 Jul 2010 11:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-1310</guid>
		<description>This worked for me ... 

# cd /Developer/SDKs
# sudo ln -s MacOSX10.5.sdk MacOSX10.4u.sdk</description>
		<content:encoded><![CDATA[<p>This worked for me &#8230; </p>
<p># cd /Developer/SDKs<br />
# sudo ln -s MacOSX10.5.sdk MacOSX10.4u.sdk</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> j-m15</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-1270</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> j-m15</dc:creator>
		<pubDate>Tue, 06 Apr 2010 03:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-1270</guid>
		<description>For the sake of sanity, make sure to use sudo and check python to see if you&#039;re running the correct one if you just installed the newest python. Best way to check it&#039;s archs is to type &quot;file $(which python)&quot; without the quotes and it will tell you. Also be sure that typing &quot;file $(which mysql)&quot; also shows whichever arch type you&#039;re going for. It really does matter if your arch types are different, I&#039;ve spent many hours fiddling with this more than once.</description>
		<content:encoded><![CDATA[<p>For the sake of sanity, make sure to use sudo and check python to see if you&#8217;re running the correct one if you just installed the newest python. Best way to check it&#8217;s archs is to type &#8220;file $(which python)&#8221; without the quotes and it will tell you. Also be sure that typing &#8220;file $(which mysql)&#8221; also shows whichever arch type you&#8217;re going for. It really does matter if your arch types are different, I&#8217;ve spent many hours fiddling with this more than once.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sophomore Dev &#187; Creating my first complete Django project on Snow Leopard</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-1022</link>
		<dc:creator>Sophomore Dev &#187; Creating my first complete Django project on Snow Leopard</dc:creator>
		<pubDate>Mon, 18 Jan 2010 19:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-1022</guid>
		<description>[...] dice, still not working. Poking through the comments of the post above, I came across this indicating that re-building doesn&#8217;t actually do it from scratch and you need to go into the [...]</description>
		<content:encoded><![CDATA[<p>[...] dice, still not working. Poking through the comments of the post above, I came across this indicating that re-building doesn&#8217;t actually do it from scratch and you need to go into the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/openid.png'/> bialecki</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-1018</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/openid.png'/> bialecki</dc:creator>
		<pubDate>Mon, 18 Jan 2010 07:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-1018</guid>
		<description>@jkeane (re comment #24), manually deleting the contents of the build directory fixed my problem with the import error.  Really annoying, but thanks for the tip.</description>
		<content:encoded><![CDATA[<p>@jkeane (re comment #24), manually deleting the contents of the build directory fixed my problem with the import error.  Really annoying, but thanks for the tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/openid.png'/> ssteiner</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-900</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/openid.png'/> ssteiner</dc:creator>
		<pubDate>Thu, 31 Dec 2009 14:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-900</guid>
		<description>I had the same problem, then noticed that I was installing with ’sudo’ while building as my regular user.

See: http://websaucesoftware.com/blog/?p=461 and part 2 at http://websaucesoftware.com/blog/?p=462

No need to change to 32 bit mode and screw everything up, just install the one with the right architecture!</description>
		<content:encoded><![CDATA[<p>I had the same problem, then noticed that I was installing with ’sudo’ while building as my regular user.</p>
<p>See: <a href="http://websaucesoftware.com/blog/?p=461" rel="nofollow">http://websaucesoftware.com/blog/?p=461</a> and part 2 at <a href="http://websaucesoftware.com/blog/?p=462" rel="nofollow">http://websaucesoftware.com/blog/?p=462</a></p>
<p>No need to change to 32 bit mode and screw everything up, just install the one with the right architecture!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WombatNation &#187; MySQL Support from Python on OS X</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-892</link>
		<dc:creator>WombatNation &#187; MySQL Support from Python on OS X</dc:creator>
		<pubDate>Wed, 30 Dec 2009 01:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-892</guid>
		<description>[...] Update 12/27/2009: With MySQL 5.1.41 and Snow Leopard (OS X 10.6), you no longer need to create the lib/mysql directory with symbolic links as described in the above article. Also, since Snow Leopard comes with Python 2.6, the path above for Eclipse should be /Library/Python/2.6/site-packages. I found Geert&#8217;s instructions to be quite helpful for Snow Leopard. There&#8217;s also a lot of useful info here. [...]</description>
		<content:encoded><![CDATA[<p>[...] Update 12/27/2009: With MySQL 5.1.41 and Snow Leopard (OS X 10.6), you no longer need to create the lib/mysql directory with symbolic links as described in the above article. Also, since Snow Leopard comes with Python 2.6, the path above for Eclipse should be /Library/Python/2.6/site-packages. I found Geert&#8217;s instructions to be quite helpful for Snow Leopard. There&#8217;s also a lot of useful info here. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> gelliott</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-763</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> gelliott</dc:creator>
		<pubDate>Fri, 04 Dec 2009 18:25:02 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-763</guid>
		<description>ok, as of dec 3, here is how i got it to work (assembling all the info so far into one spot):

versions:
mysql adapter for python: 1.2.3c1
mysql: 5.1.41 32-bit version
default python for snow leopard: 2.6.1 

1.install mysql package: http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg

2. grab mysql adapter for python: http://sourceforge.net/projects/mysql-python/files/

3.in directory for mysql for python:
Edit the setup_posix.py and change the following

mysql_config.path = &quot;mysql_config&quot;

to

mysql_config.path = &quot;/usr/local/mysql/bin/mysql_config&quot;

4. sudo ARCHFLAGS=&#039;-arch i386&#039; CC=/usr/bin/gcc-4.0 python setup.py build

5. sudo ARCHFLAGS=&#039;-arch i386&#039; CC=/usr/bin/gcc-4.0 python setup.py install

6. force python to be 32-bit
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

7. python
Greg-Elliotts-Mac-Pro:~ greg$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import MySQLdb
&gt;&gt;&gt;</description>
		<content:encoded><![CDATA[<p>ok, as of dec 3, here is how i got it to work (assembling all the info so far into one spot):</p>
<p>versions:<br />
mysql adapter for python: 1.2.3c1<br />
mysql: 5.1.41 32-bit version<br />
default python for snow leopard: 2.6.1 </p>
<p>1.install mysql package: <a href="http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg" rel="nofollow">http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg</a></p>
<p>2. grab mysql adapter for python: <a href="http://sourceforge.net/projects/mysql-python/files/" rel="nofollow">http://sourceforge.net/projects/mysql-python/files/</a></p>
<p>3.in directory for mysql for python:<br />
Edit the setup_posix.py and change the following</p>
<p>mysql_config.path = &#8220;mysql_config&#8221;</p>
<p>to</p>
<p>mysql_config.path = &#8220;/usr/local/mysql/bin/mysql_config&#8221;</p>
<p>4. sudo ARCHFLAGS=&#8217;-arch i386&#8242; CC=/usr/bin/gcc-4.0 python setup.py build</p>
<p>5. sudo ARCHFLAGS=&#8217;-arch i386&#8242; CC=/usr/bin/gcc-4.0 python setup.py install</p>
<p>6. force python to be 32-bit<br />
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes</p>
<p>7. python<br />
Greg-Elliotts-Mac-Pro:~ greg$ python<br />
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)<br />
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt; import MySQLdb<br />
&gt;&gt;&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/facebook.png'/> cd34</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-755</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/facebook.png'/> cd34</dc:creator>
		<pubDate>Thu, 03 Dec 2009 23:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-755</guid>
		<description>python setup.py clean doesn&#039;t remove the remnants from your previous failed build.

Try

make clean
python setup.py clean

and build it again, or, worst case, remove and unpack the .tgz again and build with the command line you used.  I believe the problem exists because you have some .o files from a previous build.</description>
		<content:encoded><![CDATA[<p>python setup.py clean doesn&#8217;t remove the remnants from your previous failed build.</p>
<p>Try</p>
<p>make clean<br />
python setup.py clean</p>
<p>and build it again, or, worst case, remove and unpack the .tgz again and build with the command line you used.  I believe the problem exists because you have some .o files from a previous build.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> m593026</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-754</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> m593026</dc:creator>
		<pubDate>Thu, 03 Dec 2009 23:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-754</guid>
		<description>I had to massage one of the lines that was failing (the infamous 10.4u sdk one) into this:

gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.3-fat-2.6/_mysql.so


and it successfully built and installed.  I removed the archflags entirely and it worked.

however when i try to import it...:

Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import MySQLdb
Traceback (most recent call last):
  File &quot;&quot;, line 1, in 
  File &quot;build/bdist.macosx-10.3-fat/egg/MySQLdb/__init__.py&quot;, line 19, in 
  File &quot;build/bdist.macosx-10.3-fat/egg/_mysql.py&quot;, line 7, in 
  File &quot;build/bdist.macosx-10.3-fat/egg/_mysql.py&quot;, line 6, in __bootstrap__
ImportError: dynamic module does not define init function (init_mysql)
&gt;&gt;&gt; 

Is this due to my omission of the ARCHflags? Any ideas?</description>
		<content:encoded><![CDATA[<p>I had to massage one of the lines that was failing (the infamous 10.4u sdk one) into this:</p>
<p>gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.3-fat-2.6/_mysql.so</p>
<p>and it successfully built and installed.  I removed the archflags entirely and it worked.</p>
<p>however when i try to import it&#8230;:</p>
<p>Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)<br />
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt; import MySQLdb<br />
Traceback (most recent call last):<br />
  File &#8220;&#8221;, line 1, in<br />
  File &#8220;build/bdist.macosx-10.3-fat/egg/MySQLdb/__init__.py&#8221;, line 19, in<br />
  File &#8220;build/bdist.macosx-10.3-fat/egg/_mysql.py&#8221;, line 7, in<br />
  File &#8220;build/bdist.macosx-10.3-fat/egg/_mysql.py&#8221;, line 6, in __bootstrap__<br />
ImportError: dynamic module does not define init function (init_mysql)<br />
&gt;&gt;&gt; </p>
<p>Is this due to my omission of the ARCHflags? Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: <img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> pilardi</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/comment-page-1/#comment-614</link>
		<dc:creator><img src='http://cd34.com/blog/wp-content/plugins/rpx/images/google.png'/> pilardi</dc:creator>
		<pubDate>Fri, 16 Oct 2009 15:11:14 +0000</pubDate>
		<guid isPermaLink="false">http://cd34.com/blog/?p=750#comment-614</guid>
		<description>In order to make it work on my system: Snow leopard i386, I had to force python to run in 32 bits mode. So if you want to use 32 bits mysql version, and you are using python &gt; 2.5 you have to force python to use 32 bit architecture, since by default it uses 64 bits. note: osx 10.6 comes with python 2.6 by default.

You can set it system wide by doing  in your console:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

or just in your session:

export VERSIONER_PYTHON_PREFER_32_BIT=yes

, also I had to force the gcc compiler to use 32 bit architecture when building:

ARCHFLAGS=&#039;-arch i386&#039;

hope it helps someone, it really helped me!

- Pablo</description>
		<content:encoded><![CDATA[<p>In order to make it work on my system: Snow leopard i386, I had to force python to run in 32 bits mode. So if you want to use 32 bits mysql version, and you are using python &gt; 2.5 you have to force python to use 32 bit architecture, since by default it uses 64 bits. note: osx 10.6 comes with python 2.6 by default.</p>
<p>You can set it system wide by doing  in your console:</p>
<p>defaults write com.apple.versioner.python Prefer-32-Bit -bool yes</p>
<p>or just in your session:</p>
<p>export VERSIONER_PYTHON_PREFER_32_BIT=yes</p>
<p>, also I had to force the gcc compiler to use 32 bit architecture when building:</p>
<p>ARCHFLAGS=&#8217;-arch i386&#8242;</p>
<p>hope it helps someone, it really helped me!</p>
<p>- Pablo</p>
]]></content:encoded>
	</item>
</channel>
</rss>
