0
我在CentOS機器上安裝了各種版本的python(python2.4和python2.7)。我安裝了MySQL-python的,但我只能在導入的python2.4 的MySQLdb的模塊,但不python2.7爲python2.7安裝MySQLdb
root# python2.7
Python 2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:08:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named MySQLdb
root# python
Python 2.4.3 (#1, Mar 5 2011, 21:26:05)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
我試過alias'ing蟒蛇/usr/bin/python2.7和然後做一個'yum刪除MySQL-python',然後做一個'yum安裝MySQL-python',但沒有運氣。任何線索/見解?謝謝。