python3安装mysqldb_如何使用python 3.2安装MySQLdb

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值