【问题标题】:While installing MySQL-python using pip am ending up with the following output and unable to install MySQLdb使用 pip 安装 MySQL-python 时出现以下输出并且无法安装 MySQLdb
【发布时间】:2016-05-29 00:03:31
【问题描述】:
  _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No
 such file or directory
  error: command '"C:\Users\mahendra.gaur\AppData\Local\Programs\Common\Microsof
t\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2

然后下面的代码显示为红色

Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:
\users\\mahend~1.gau\\appdata\\local\\temp\\pip-build-zxhadg\\MySQL-python\\set
p.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r
n', '\n'), __file__, 'exec'))" install --record c:\users\mahend~1.gau\appdata\l
cal\temp\pip-x_l2nw-record\install-record.txt --single-version-externally-manag
d --compile" failed with error code 1 in c:\users\mahend~1.gau\appdata\local\te
p\pip-build-zxhadg\MySQL-python

【问题讨论】:

    标签: python python-2.7 pip mysql-python


    【解决方案1】:

    如果您无法在 Windows 上编译该软件包,您可以安装预编译的二进制文件:

    http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
    

    只需下载.whl文件并使用安装

    pip install MySQL_python-1.2.5-cp27-none-win32.whl
    

    pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl
    

    取决于您的系统架构。

    【讨论】:

      猜你喜欢
      • 2017-05-08
      • 2013-09-05
      • 2014-12-15
      • 1970-01-01
      • 2016-12-21
      • 1970-01-01
      • 2011-03-06
      • 2021-01-23
      • 2018-12-03
      相关资源
      最近更新 更多