linux下用pip安装mysqldb出错,执行 pip install MySQL-python出错

(xx) sunshine@sunshine-ThinkPad-E420:~/xx$ pip install MySQL-python

Downloading/unpacking MySQL-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/home/sunshine/xx/build/MySQL-python/setup.py) egg_info for package MySQL-python
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/sunshine/xx/build/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/home/sunshine/xx/build/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "/home/sunshine/xx/build/MySQL-python/setup.py", line 13, in <module>

from setup_posix import get_config

File "/home/sunshine/xx/build/MySQL-python/setup_posix.py", line 2, in <module>

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/sunshine/xx/build/MySQL-python
Storing debug log for failure in /home/sunshine/.pip/pip.log
(xx) sunshine@sunshine-ThinkPad-E420:~/xx$
ImportError: No module 蔽旁州named 'ConfigParser'宏蔽

你要么尝试安装下 ConfigParser ,然后重新安装试试看启袜。


1、轮胡先安装mysql-devel.x86_64
# yum install mysql-devel.x86_64

2、在次冲桐迅执行安装散此mysql-ptyhon
#pip install mysql-python