wget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz
tar xfz mod_python-2.7.11.tgz <br>cd python-2.7.11<br>
安装
./config --prefix=/usr/local/python/
make && make install
ln -s /usr/local/python/bin/python2.7 /usr/bin/
ln -s /usr/local/python/bin/python/usr/bin/
二、安装setuptools
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sh setuptools-0.6c11-py2.7.egg
ldconfig #让它生效
三、安装 mysqldb模块
wget http://cdnetworks-kr-2.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
cd MySQL-python
python2.7 setup.py build
# #ln -s /usr/local/python/bin/python2.7 /usr/bin/(注意建立连接)
python2.7 setup.py install ##安装
测试:
[root@localhost conf]# python2.7
Python 2.7.1 (r271:86832, Mar 21 2011, 10:13:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
tar xvf mod_python-3.3.0b.tgz
cd mod_python-3.3.0b
./configure --with-apxs=/usr/sbin/apxs --with-python=/usr/local/python/bin/python ###(apache支持python)
make && make install
Python 2.7.1 (r271:86832, Mar 21 2011, 10:13:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod_python
>>>
五、安装Django
wget http://www.djangoproject.com/download/1.2.5/tarball/
tar xfz Django-1.2.5.tar.gz
cd Django-1.2.5
python2.7 setup.py install
测试:
[root@localhost conf]# python
Python 2.7.1 (r271:86832, Mar 21 2011, 10:13:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>>