python安装MySQLdb失败

python安装MySQLdb失败


python版本访问数据库需要借助模块MySQLdb,安装MySQLdb的方法有两种:

  • pip在线安装pip install MySQLdb
    在线安装因为有一部分C代码代码需要使用VC9编译器进行编译,但是机器一般没有安装VC9(VC2008)编译器。所以会安装失败。
  error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27
  ----------------------------------------
  Failed building wheel for MySQL-python
  Running setup.py clean for MySQL-python
Failed to build MySQL-python
  • 下载exe安装包安装
    https://pypi.python.org/pypi/MySQL-python/1.2.5

你可能感兴趣的:(python安装MySQLdb失败)