I'm trying to connect to mySQL with python. From what I understand you need to have MySQLdb which is some python connector module. My first problem was not having the right version of the mySQLdb. It can be found here. Then I am supposed to open a command line window and navigate to the path of the file I just downloaded (after unzipping) and typepython setup.py build This then gave me an error saying that I needed to downloaded setup tools. Setup tools apparently was discontinued after python 2.6 or 7. Now we are supposed to use distribute, which I found here, as a replacement. I did that and now when I try to make my build call It spits out
Traceback (most recent call last):
File "setup.py", line 13, in
from setup_windows import get_config
File "C:\Program Files\MySQL\MySQL-python-1.2.3\setup_windows.py", line 46
print """You shouldn't be running this directly; it is used by setip.py."""
Syntax Error: invalid syntax
I need someone to hold my hand and walk me through how to get this setup. I've spent 6 hours on google trying to figure it out. (I read in more than one place that it is a difficult install but very worth it. I hope they're right.)
解决方案
After further googling I don't think that using mysqldb or whatever is the best solution. I found this page: http://wiki.python.org/moin/MySQL
I decided to give the mysql connector/python a try. It seems pretty straightforward with no crazy installs.