2010-06-15 13 views
65

Questo è quello che ho cercato:Perché easy_install non trova MySQLdb?

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

risposta

140

avete il nome del pacchetto sbagliato.

MySQL-python è quella giusta:

 
easy_install MySQL-python 

o

 
pip install MySQL-python 
+2

Mi sembra che questo è attualmente l'installazione di MySQL-python 1.2.2, che non contiene MySQLdb 1.2.3 – BryanWheelock

+0

Giusto. Link fisso. – bernie

+0

Ho lavorato con 'MySQLdb', ma ora sembra essere incalcolabile. MySQL-python contiene MySQLdb? O devo cambiare il mio codice? –

7

Adam è giusto, ma prima di eseguire easy_install MySQL-python è necessario assicurarsi che python-dev è installato in quanto non è installato di default.

L'installazione è con apt-get install python-dev.

5

Se si utilizza "yum" il comando è sudo yum install python-devel (dove 'sudo' può essere opzionale a seconda del vostro account utente)

Problemi correlati