为什么不能easy_installfindMySQLdb?

这是我试过的:

$ easy_install-2.6 -d /home/user/lib/python2.6 MySQLdb Searching for MySQLdb Reading http://pypi.python.org/simple/MySQLdb/ Couldn't find index page for 'MySQLdb' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ No local packages or download links found for MySQLdb error: Could not find suitable distribution for Requirement.parse('MySQLdb') 

你有错误的包名称。

MySQL-python是正确的:

 easy_install MySQL-python

要么

 pip安装MySQL-python

Adam是正确的,但在运行easy_install MySQL-python您需要确保安装了python-dev ,因为默认情况下未安装它。

安装是用apt-get install python-dev

如果您使用的是“yum”,则命令是sudo yum install python-devel (其中根据您的用户帐户,“sudo”可能是可选的)