CodeTalk
CodeTalk

Reputation: 3667

MYSqlDb and Python to play nice together

Disclaimer: I've tried numerous searches and procedures to get this to work as I've found from trying to google this issue, but none seem to work.

I am getting the following when I try to import MySQLdb under Python Interactive Shell...

 Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) 
    [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "MySQLdb/__init__.py", line 23, in <module>
        (version_info, _mysql.version_info))
    ImportError: this is MySQLdb version (1, 2, 4, 'beta', 4), but _mysql is version (1, 2, 4, 'final', 1)

Any suggestions on what to do? I had installed MySQLdb via pip

Upvotes: 2

Views: 835

Answers (1)

SoonerBourne
SoonerBourne

Reputation: 61

I don't have a Mac, so I can't really test this, however, Mac seems to have problems with this module. Have you checked out this guy's site? It seems pretty thorough in going through the setup with a Mac.

http://learninglamp.wordpress.com/2010/02/21/mysqldb-python-mysql-and-os-x-a-match-made-in-satans-bum/

Hopefully this helps you out a bit.

Upvotes: 1

Related Questions