Why can't easy_install find MySQLdb?

社会主义新天地 提交于 2019-12-03 02:04:10

问题


This is what I tried:

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

回答1:


You have the wrong package name.

MySQL-python is the right one:

easy_install MySQL-python

or

pip install MySQL-python



回答2:


Adam is right but before you run easy_install MySQL-python you need to make sure python-dev is installed as it is not installed by default.

Install is with apt-get install python-dev.




回答3:


If you are using "yum" the command is sudo yum install python-devel (where 'sudo' may be optional depending on your user account)



来源:https://stackoverflow.com/questions/3047848/why-cant-easy-install-find-mysqldb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!