Python2.7.5 安装
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar –zxvf Python-2.7.3.tgz
?
./configure
注:如果报configure: error: C compiler cannot create executables错误,则进行一下步骤。
export LIBS=
export?CFLAGS=
?
如仍报错,则:yum install glibc-*
make all
make install
make clean
make distclean
验证安装版本:/usr/local/bin/python2.7 –V
mv /usr/bin/python /usr/bin/python-bak
ln -s /usr/local/bin/python2.7 /usr/bin/python
vim /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.4
就可以继续使用yum了
wget http://jaist.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
?
tar –zxvf MySQL-python-1.2.3.tar.gz
yum install mysql-devel
vim site.cfg
把#mysql_config = /usr/local/bin/mysql_config修改为
mysql_config = /usr/bin/mysql_config
python ez_setup.py
python setup.py build
python setup.py install
import MySQLdb