Why can't easy_install find MySQLdb?

PythonMysqlEasy Install

Python Problem Overview


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

Python Solutions


Solution 1 - Python

You have the wrong package name.

MySQL-python is the right one:

easy_install MySQL-python

or

pip install MySQL-python

Solution 2 - Python

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.

Solution 3 - Python

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBryanWheelockView Question on Stackoverflow
Solution 1 - Pythonmechanical_meatView Answer on Stackoverflow
Solution 2 - PythonJeff HView Answer on Stackoverflow
Solution 3 - PythonAdamView Answer on Stackoverflow