66

这是我尝试过的:

$ 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')  
4

3 回答 3

143

你有错误的包名。

MySQL-python是正确的:

easy_install MySQL-python

或者

点安装 MySQL-python
于 2010-06-15T18:25:12.463 回答
8

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

安装与apt-get install python-dev.

于 2010-12-31T21:19:14.673 回答
5

如果您使用“yum”,则该命令是sudo yum install python-devel(其中“sudo”可能是可选的,具体取决于您的用户帐户)

于 2012-11-27T01:25:35.440 回答