linux pip mysql-python,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 "", line 17, in

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

from setup_posix import get_config

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

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

Complete output from command python setup.py egg_info:

Traceback (most recent call last):

File "", line 17, in

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

from setup_posix import get_config

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

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$

辅助答案

用户:wuxiuhe

2017年09月14日

1、先安装mysql-devel.x86_64

# yum install mysql-devel.x86_64

2、在次执行安装mysql-ptyhon

#pip install mysql-python

用户:麦兜123456

2017年09月12日

ImportError: No module named 'ConfigParser'

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