【问题标题】:python can't install mysql librarypython无法安装mysql库
【发布时间】:2014-07-29 11:08:19
【问题描述】:

我想从 python 连接到 mysql 数据库

我尝试这样做:pip install mysql-python 正如这个问题所建议的No module named MySQLdb

但我遇到了这个异常

Cleaning up...
Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\use
rs\\user\\appdata\\local\\temp\\pip_build_User\\mysql-python\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-kkagjy-re
cord\install-record.txt --single-version-externally-managed --compile failed wit
h error code 1 in c:\users\user\appdata\local\temp\pip_build_User\mysql-python
Storing debug log for failure in C:\Users\User\pip\pip.log

在我的 python 代码中,我不断收到此错误

No module named MySQLdb

我使用的是 Windows 7

【问题讨论】:

  • 您需要一个 c 编译器和一个工具链设置来安装它。你有安装c编译器吗?您使用什么操作系统?你可能想看看这篇博文:mysql-python.blogspot.ca/2012/11/…
  • @shuttle87 我使用的是 Windows 7
  • @shuttle87 你建议的博客我必须拥有vs2008 的统计数据,现在这是不可能的。我有vs2012

标签: python mysql python-2.7 pip


【解决方案1】:

我自己找到了解决办法

http://www.codegood.com/archives/129

下载就够了

【讨论】:

猜你喜欢
  • 2012-10-11
  • 1970-01-01
  • 2014-04-20
  • 2021-01-24
  • 2015-03-01
  • 2013-09-05
  • 2018-07-16
相关资源
最近更新 更多