2017-04-20 58 views
0

我試圖安裝mysql-python模塊中的OS X 10.12.4,但我有以下消息錯誤安裝的Python MySQLdb的OS X 10.12.4

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,我仍然有同樣的錯誤

+0

確保你有正確的版本,你正在尋找... –

+0

我安裝了PIP,如何知道我需要哪個版本? –

回答

0

陶然成在一個乾淨的OS X塞拉利昂環境相同的問題,並

pip install mysql-connector-python==2.1.3 

爲我工作,2.1。即使安裝了Xcode和mysql-connector-c,6似乎也有問題。