无法在MacOS 10.12.4上使用pip安装mysql-python [英] Can't install mysql-python with pip on MacOS 10.12.4

查看:93
本文介绍了无法在MacOS 10.12.4上使用pip安装mysql-python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行pip install 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/var/folders/b_/xh05hxwd0lzc3rm858jsypdc0000gn/T/pip-build-AWDYaP/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/var/folders/b_/xh05hxwd0lzc3rm858jsypdc0000gn/T/pip-build-AWDYaP/mysql-python/

我按照 https://www.python.org重新安装了Python /

I followed the instructions in this post around reinstalling setuptools and I have reinstalled Python from https://www.python.org/

which -a python给出

/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/usr/local/bin/python
/usr/bin/python

自安装MacOS 10.12.4更新以来,似乎已发生错误

The error seems to have occurred since installing MacOS 10.12.4 update

推荐答案

已解决

brew install mysql
pip install MySQL-python

这篇关于无法在MacOS 10.12.4上使用pip安装mysql-python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆