【发布时间】:2017-03-04 11:05:23
【问题描述】:
我目前使用的是 Mac OS X 10.12。我正在尝试安装 MySQLdb,但一直收到这些错误。
当我运行 sudo pip install MySQLdb 时,错误信息是:
Collecting MySQL-python
Downloading MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 112kB 233kB/s
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-m1bhp0l0/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-build-m1bhp0l0/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-m1bhp0l0/MySQL-python/
然后我尝试下载 MySQL-python-1.2.4b4,并使用它直接运行 setup.py。然后我得到了这个错误:
Traceback (most recent call last):
File "/Users/phil/Downloads/MySQL-python-1.2.4b4 2/setup.py", line 18, in <module>
metadata, options = get_config()
File "/Users/phil/Downloads/MySQL-python-1.2.4b4 2/setup_posix.py", line 32, in get_config
metadata, options = get_metadata_and_options()
File "/Users/phil/Downloads/MySQL-python-1.2.4b4 2/setup_common.py", line 12, in get_metadata_and_options
metadata = dict(config.items('metadata'))
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 642, in items
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'metadata'
尝试了很多解决方案。仍然有很多错误。 请在这里帮忙。
【问题讨论】:
标签: mysql django macos python-2.7