[root@myserver bin]# pip3.5 install MySQL-python
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 "/tmp/pip-build-ahudhqst/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-ahudhqst/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 /tmp/pip-build-ahudhqst/MySQL-python/
[root@myserver bin]#
我安装MySQL-python (for django)失败。我能知道为什么会出现这个错误吗?我用的是centos 6.5
我认为你应该卸载python,然后下载并重新安装。有三种下载基于web的安装程序,可执行的安装程序,可嵌入的zip文件。您必须确保下载了可执行的安装程序。当你做完的时候。转到命令提示符(确保您有管理权限)并键入python。它应该返回python版本。输入PIP,它应该返回PIP可以执行的命令。这样可以确保正确安装。如果不是的话,你需要得到pip。否则,您需要更新setuptools,特别是对于旧版本的python。本页有所有必要的命令行提示https://packaging.python.org/tutorials/installing-packages/