【问题标题】:Error installation python MySQLdb OS X 10.12.4安装python MySQLdb OS X 10.12.4时出错
【发布时间】:2017-09-17 11:15:31
【问题描述】:

我正在尝试在 OS X 10.12.4 中安装 mysql-python 模块,但我收到以下消息

Collecting mysql-python
  Using cached MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-build-KAgV3I/mysql-python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 53, in get_config
        libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ]
      File "setup_posix.py", line 8, in dequote
        if s[0] in "\"'" and s[0] == s[-1]:
    IndexError: string index out of range

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-KAgV3I/mysql-python/

我已经安装了mysql-connector-cXcode-select --install,但我仍然有同样的错误

【问题讨论】:

  • 确保您拥有您正在寻找的正确版本...
  • 我是用pip安装的,怎么知道需要哪个版本?

标签: python macos mysql-python


【解决方案1】:

在干净的 OS X Sierra 环境中遇到了同样的问题,并且

pip install mysql-connector-python==2.1.3

为我工作,即使安装了 Xcode 和 mysql-connector-c,2.1.6 似乎也有问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-06
    • 2011-07-28
    • 2015-01-20
    • 2018-11-26
    • 2011-08-24
    • 2013-07-26
    • 2014-11-19
    • 1970-01-01
    相关资源
    最近更新 更多