Mac下安装MySQLdb

由于重装过MySQL,开始port uninstall mysql5的时候相依赖的MySQLdb也要uninstall,所以需要重新装一下MySQLdb -- Python interface to mysql。
ericdemacbook:~ Eric$ sudo port install py26-mysql
--->  Fetching py26-mysql
--->  Verifying checksum(s) for py26-mysql
--->  Extracting py26-mysql
--->  Applying patches to py26-mysql
--->  Configuring py26-mysql
--->  Building py26-mysql
--->  Staging py26-mysql into destroot
--->  Installing py26-mysql @1.2.2_0+mysql5
--->  Activating py26-mysql @1.2.2_0+mysql5
--->  Cleaning py26-mysql
ericdemacbook:~ Eric$ python 
Python 2.6.2 (r262:71600, Jul 25 2009, 17:16:37) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
  from sets import ImmutableSet
>>> #上面是MySQLdb在Python2.6下的小bug吧
>>> print MySQLdb.version_info
(1, 2, 2, 'final', 0)

你可能感兴趣的:(apple,mysql,python,gcc)