<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python &#8211; Avian Bone Syndrome</title>
	<atom:link href="https://www.avianbonesyndrome.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.avianbonesyndrome.com</link>
	<description>An exercise in futility by Daniele Nicolucci</description>
	<lastBuildDate>Wed, 14 Jul 2010 07:52:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.avianbonesyndrome.com/wp-content/uploads/2015/04/cropped-cover-sito-32x32.jpg</url>
	<title>python &#8211; Avian Bone Syndrome</title>
	<link>https://www.avianbonesyndrome.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">12285558</site>	<item>
		<title>Installing the MySQLdb Python module on Snow Leopard</title>
		<link>https://www.avianbonesyndrome.com/2010/04/04/installing-the-mysqldb-python-module-on-snow-leopard/</link>
					<comments>https://www.avianbonesyndrome.com/2010/04/04/installing-the-mysqldb-python-module-on-snow-leopard/#comments</comments>
		
		<dc:creator><![CDATA[Daniele Nicolucci]]></dc:creator>
		<pubDate>Sun, 04 Apr 2010 14:37:27 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldb]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://www.avianbonesyndrome.com/?p=17</guid>

					<description><![CDATA[Needing to access a MySQL database through Python, I was faced by the inability to easily install the MySQLdb module. I do use MacPorts, but after running the obvious sudo port install py26-mysql I realized that I would be downloading, compiling and installing a new instance of Python, a new instance of MySQL (I prefer the simplicity of MAMP), and who knows what else. Installing the module alone doesn&#8217;t work, because MAMP installs no headers; and copying the headers from the vanilla MySQL distribution doesn&#8217;t help either, because a few of the required files are generated on the fly during the installation of MySQL itself. The solution, it turns out, is relatively simple. Follow along. Step 1: download the latest MySQL Community Server in DMG format for x86-64 from this page, and install the main package. Worry not: nothing is going to be started on boot, so this is not going&#8230;]]></description>
										<content:encoded><![CDATA[<p>Needing to access a MySQL database through Python, I was faced by the inability to easily install the <a href="http://sourceforge.net/projects/mysql-python/">MySQLdb module</a>. I do use <a href="http://www.macports.org/">MacPorts</a>, but after running the obvious<br />
<code>sudo port install py26-mysql</code><br />
I realized that I would be downloading, compiling and installing a new instance of Python, a new instance of MySQL (I prefer the simplicity of <a href="http://www.mamp.info/">MAMP</a>), and who knows what else.</p>
<p>Installing the module alone doesn&#8217;t work, because MAMP installs no headers; and copying the headers from the vanilla MySQL distribution doesn&#8217;t help either, because a few of the required files are generated on the fly during the installation of MySQL itself.</p>
<p>The solution, it turns out, is relatively simple. Follow along.<span id="more-17"></span></p>
<p>Step 1: download the latest MySQL Community Server in DMG format for x86-64 from <a href="http://dev.mysql.com/downloads/mysql/">this page</a>, and install the main package. Worry not: nothing is going to be started on boot, so this is not going to mess with your pre-existing MySQL installation. The package is going to be installed in /usr/local/mysql-5.1.45-osx10.6-x86_64/, with a handy /usr/local/mysql/ symbolic link.</p>
<p>Step 2: download the latest MySQLdb Python module from <a href="http://sourceforge.net/projects/mysql-python/">this page</a>, and unpack it somewhere.</p>
<p>Step 3: set the $PATH environment variable to include /usr/local/mysql. That&#8217;s because the module&#8217;s setup.py is going to need to call mysql_config, and you want it to find the one you just installed, as it comes with all the stuff it needs.</p>
<p>Step 4: do the classic build and install dance, making sure you prepend the commands with ARCHFLAGS=&#8217;-arch x86_64&#8242;. This is because you want to compile a 64-bit module.</p>
<p>In short:<br />
<code>tar vxfz MySQL-python-1.2.3c1.tar.gz<br />
cd MySQL-python-1.2.3c1<br />
export PATH=/usr/local/mysql:$PATH<br />
ARCHFLAGS='-arch x86_64' python setup.py build<br />
ARCHFLAGS='-arch x86_64' python setup.py install</code></p>
<p>If all went fine, you should be able to do this without getting any errors:<br />
<code>octavarium:~ jollino$ python<br />
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)<br />
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin<br />
Type "help", "copyright", "credits" or "license" for more information.<br />
&gt;&gt;&gt; import MySQLdb<br />
&gt;&gt;&gt; print MySQLdb<br />
&lt;module 'MySQLdb' from '/Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/MySQLdb/__init__.pyc'&gt;</code></p>
<p>Enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.avianbonesyndrome.com/2010/04/04/installing-the-mysqldb-python-module-on-snow-leopard/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">17</post-id>	</item>
	</channel>
</rss>
