---
title: "Dreamhost 上编译python并安装django"
author: "simon_zhang"
date: "2009-03-19T16:02:58Z"
tags: []
slug: "dreamhost-python-django"
draft: false
lastmod: "2009-03-19T16:02:58Z"
id: 351587
url: "https://mogee.iteye.com/blog/351587"
---

2008年11月5日 | 分类: [Linux&Webserver](http://www.lostk.com/blog/category/linuxwebserver/ "查看 Linux&Webserver 的全部文章") | 标签: [django](http://www.lostk.com/blog/tag/django/), [dreamhost](http://www.lostk.com/blog/tag/dreamhost/), [python](http://www.lostk.com/blog/tag/python/)

**1. 升级python到2.5.2:**

用Putty登录到DreamHost的Shell控制台执行如下的命令:

[view source](http://www.lostk.com/blog/configure_python_and_django_on_dreamhost/#viewSource "view source")[print](http://www.lostk.com/blog/configure_python_and_django_on_dreamhost/#printSource "print")[?](http://www.lostk.com/blog/configure_python_and_django_on_dreamhost/#about "?")

`01.mkdir` `opt`

`02.cd` `opt`

`03.mkdir` `packages`

`04.cd` `packages`

`05.wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz`

`06.tar` `-xzvf Python-2.5.2.tgz`

`07.cd` `Python-2.5.2`

`08../configure -prefix=$HOME/opt`

`09.make`

`10.make` `install`

python 2.5已经安装好了。把python 2.5设置为默认版本：

[view source](http://www.lostk.com/blog/configure_python_and_django_on_dreamhost/#viewSource "view source")[print](http://www.lostk.com/blog/configure_python_and_django_on_dreamhost/#printSource "print")[?](http://www.lostk.com/blog/configure_python_and_django_on_dreamhost/#about "?")

`1.`