Python 安装 MySQL-python ImportError: No module named 'ConfigParser'

系统: CentOS-6.4-x86_64 python

Python : Python 3.4.5 和 Python 3.5.2 mysql

 

安装 MySQL-python ,结果出错:sql

ImportError: No module named 'ConfigParser'centos

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ry1be27_/mysql-python/ui

 

缘由:spa

在 Python 3.x 版本后,ConfigParser.py 已经改名为 configparser.py 因此出错!code

 

能够看看系统中的 python 命令 ,系统自带个 python 2.6。ip

[root@centos]# ls /usr/bin/python*
/usr/bin/python /usr/bin/python2 /usr/bin/python2.6
[root@centos]#
[root@centos]# python2.6 -V
Python 2.6.6
[root@centos]#it


解决方法:pip

找到文件 configparser ,改名为旧版本的名称 ConfigParser

cp /usr/local/Python34/lib/python3.4/configparser.py /usr/local/Python34/lib/python3.4/ConfigParser.py

相关文章
相关标签/搜索