Python安装MySQLdb问题(win7 32位)

问题描述:由于之前使用python3.2.2版本,使用很多第三方库不方便,就将python重装为python2.7.4版本,当时装的MySQLdb也忘了,现在到使用时才想起要重装MySQLdb,就用pip install mysql-python直接安装,但是报错,如下图mysqldb

 

环境工具:Win7(32bit)  Python2.7.4

 

解决过程:看到一篇英文技术文章,部分摘录如下

Installing mysql module for python
I rate this mission as : impossible for the everyday developer on windows.
Here are several of the problems I got along the way :

_mysql.c:34:24: fatal error: config-win.h: No such file or directory
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified
error: Unable to find vcvarsall.bat

Save yourself the headache -
Search for a "download compiled python 2.7 mysql for windows"
change the query to your python version.
Do not stop until you find a file named
"MySQL-python-1.2.3.win32-py2.7.exe"

again - version might be different.

Do not go on the mission of installing it by yourself, it is simply a nightmare.

意思就是说下载已经针对win7 32编译好的MySQLdb来安装

想起来,之前的MySQLdb也不是通过pip安装的,只好去下载一个MySQL-python-1.2.3.win32-py2.7.exe来安装,很快OK。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值