1:下载Python-2.7.8.tgz
2:步骤:
tar -zxvf Python-2.7.8.tgz
cd Python-2.7.8
./configure -h --查看configure选项
./configure
make
make install
3:环境设置
rm -rf /usr/bin/python
cp /usr/local/bin/python /usr/bin/python
vim /usr/bin/yum
#!/usr/bin/python2.6
4:安装setuptools
根据pypi上提示的方法,执行
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
5:安装pip
下载pip-1.5.6.tar.gz
tar -zxvf pip-1.5.6.tar.gz
cd pip-1.5.6
python setup.py install
6:安装Django
pip install django
验证:
python
import django
django.VERSION
(1, 7, 1, 'final', 0)