2014-09-12 96 views
0

我正在爲Centos VPS安裝MySQL-python而苦苦掙扎。我有「主」Python 2.6(一個自動與CentOS一起發佈),另一個是我在2.7之後安裝的。所以我用這個命令:使用easy-install安裝MySQL-python失敗

easy_install-2.7 MySQL-python 

但它再現了以下錯誤:

Searching for MySQL-python 
Reading https://pypi.python.org/simple/MySQL-python/ 
Download error on https://pypi.python.org/simple/MySQL-python/: unknown url type: https -- Some  packages may not be found! 
Couldn't find index page for 'MySQL-python' (maybe misspelled?) 
Scanning index of all packages (this may take a while) 
Reading https://pypi.python.org/simple/ 
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may  not be found! 
No local packages or download links found for MySQL-python 
error: Could not find suitable distribution for Requirement.parse('MySQL-python') 

感謝您閱讀我的問題,並可能試圖幫助!

+0

爲什麼不使用'pip'而不是'easy_install'? – 2014-09-12 20:49:55

+0

@MauroBaraldi我試過了,但是pip爲我的2.6 python下載了所有東西,正如我試過的那樣,pip-2.7不能像那樣工作。我如何使用pip-2.7? – 2014-09-12 20:52:13

回答

0

也許你使用的是舊版本的easy_install,這可能是問題的根源。您可以按照distributedoc包的說明進行操作,並且可以安裝pip。由於您已安裝pip,您可以輕鬆安裝MySQL-python

+0

我這樣做了,但是當我嘗試使用pip來安裝它時,它將它安裝爲python 2.6,而不是2.7,我想... – 2014-09-12 21:14:54

0

也許嘗試使用一些句子,其中包括mysqldb。