<?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>Random Musings of an Insane Mind &#187; virtualenv</title>
	<atom:link href="http://cd34.com/blog/tag/virtualenv/feed/" rel="self" type="application/rss+xml" />
	<link>http://cd34.com/blog</link>
	<description>This is my blog, there are many others like it but this one is mine.</description>
	<lastBuildDate>Tue, 29 Jun 2010 04:22:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>mysql-python and Snow Leopard</title>
		<link>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/</link>
		<comments>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 16:21:32 +0000</pubDate>
		<dc:creator>cd34</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[mac os/x]]></category>
		<category><![CDATA[mysql-python]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://cd34.com/blog/?p=750</guid>
		<description><![CDATA[After the upgrade to Snow Leopard, mysql-python cannot be installed through easy_install. * Install mysql&#8217;s x86_64 version from the .dmg file (I had a problem doing this when booted into the 64bit kernel, a 32bit kernel macbook had no problem) With the 64bit kernel, the system reported &#8216;no mountable file systems&#8217; when trying to mount [...]]]></description>
			<content:encoded><![CDATA[<p>After the upgrade to Snow Leopard, mysql-python cannot be installed through easy_install.</p>
<p>* Install <a href="http://dev.mysql.com/downloads/mysql/5.1.html#downloads">mysql&#8217;s x86_64</a> version from the .dmg file (I had a problem doing this when booted into the 64bit kernel, a 32bit kernel macbook had no problem)  With the 64bit kernel, the system reported &#8216;no mountable file systems&#8217; when trying to mount the .dmg file.  A reboot into 32bit mode allowed the .dmg to be mounted and installed.<br />
* Change into your virtual environment if desired, source bin/activate<br />
* fetch <a href="http://sourceforge.net/projects/mysql-python/">MySQL-python-1.2.3c1</a></p>
<pre>
tar xzf MySQL-python-1.2.3c1.tar.gz
cd MySQL-python-1.2.3c1
ARCHFLAGS='-arch x86_64' python setup.py build
ARCHFLAGS='-arch x86_64' python setup.py install
</pre>
<p>If everything works, you should see:</p>
<pre>
$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
</pre>
<p>Some of the possible things you&#8217;ll encounter:</p>
<p>After <strong>python setup.py build</strong>:</p>
<pre>
ld: warning: in build/temp.macosx-10.6-universal-2.6/_mysql.o, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture
ld: warning: in build/temp.macosx-10.6-universal-2.6/_mysql.o, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture
</pre>
<p>This means that you have the i386 version of mysql installed.  Or, if you have the x86_64 version, you have didn&#8217;t include the proper ARCHFLAGS command.</p>
<p><strong>ImportError: dynamic module does not define init function (init_mysql)</strong></p>
<p>this means that the easy_install or the build/install process was run which tried to build a ppc/i386/x86_64 combined build.</p>
<p>If you see messages like:</p>
<pre>
$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/Users/xxxxx/Python/django/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Users/xxxxx/Python/django/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/_mysql.pyc, but /Users/xxxxx/Python/django/MySQL-python-1.2.3c1 is being added to sys.path
>>>
</pre>
<p>Then you are still in the build directory.  cd ..  and try again.</p>
]]></content:encoded>
			<wfw:commentRss>http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
	</channel>
</rss>
