Skip to content

Upgrading Python on a Dreamhost Account

by Jeff

Java is just my day job. In fact, it’s pretty dull too sometimes. I like to venture out when I can and work with other technologies. In this case, I’ve been messing around with Django on my Dreamhost account. This short tutorial is intended to be the first of several related to Python and Django.

Ssh to your DH account, from the base dir…

$ mkdir opt
$ mkdir downloads
$ cd downloads
$ wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
$ tar xvzf Python-2.5.2.tgz
$ cd Python-2.5.2
$ ./configure --prefix=$HOME/opt/ --enable-unicode=ucs4
$ make
$ make install

If that completes correctly, you can remove the tarball and the Python2.5.2 directory.

Next, update your path by adding:

export PATH=$HOME/opt/bin/:$PATH

to your .bash_profile. Then test:

$ source .bash_profile
$ python -V
Python 2.5.2

If you don’t see Python 2.5.2 after typing python -V then you’ve already done something wrong.

Next, update MySql-Python (from the downloads directory):

$ wget http://internap.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gz
$ tar xvzf MySQL-python-1.2.2.tar.gz
$ cd MySQL-python-1.2.2
$ python setup.py install

Make sure the files extract into the ~/opt/lib/python2.5/site-packages/ directory as an egg file.

Now that we have everything upgraded nicely, we can move on to installing Django.

References:

Custom Python Install by LocalKineGrinds

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

3 Trackbacks/Pingbacks

  1. Shane Ahern’s Weblog » Blog Archive » links for 2009-04-29 on Wednesday, April 29, 2009 at 4:04 pm

    [...] Upgrade python on dreamhost (tags: howto python dreamhost django) [...]

  2. In the Cloud » Hosting Git repositories on Dreamhost on Tuesday, May 5, 2009 at 10:24 pm

    [...] the Python version on my Dreamhost machine: 2.3.5. I decided to upgrade to a later version as per these instructions. I installed Python 2.6.2 instead of the mentioned 2.5.2. This was the latest stable version in the [...]

  3. REVERT TO CONSOLE › Dreamhost Django Install, Revised Edition on Wednesday, January 20, 2010 at 8:28 pm

    [...] started by upgrading Python for my Dreamhost user. I followed my own post, except that I used Python 2.6 instead of 2.5. I missed one step that was caught by a pingback [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*