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]

2 Comments

  1. Josh wrote:

    Hi there, you seem to have many posts relating to django and dreamhost. I have a dreamhost account and am running django on it. I seem to be having an issue with the pyfacebook package. If I try to add the Middleware ‘facebook.djangofb.Middleware’ it well, breaks everything, and the app never gives a response. I was wondering if you have ever had this problem, or if you could point me in a direction to solving it?

    Thank you
    Josh

    Monday, June 14, 2010 at 10:56 am | Permalink
  2. Jeff wrote:

    Hi Josh, I’m far from being an expert with Django, it’s a hobby for me, not my day job.
    That said, the most useful info I’ve gotten for debugging is the output in the browser.
    If you’re not getting a response, then I’d be inclined to look at the installation itself- did the facebook.djangofb.Middleware actually install correctly? Did you use easyinstall and were there errors during that process? That would be where I would start. Hope that helps.

    Monday, June 14, 2010 at 3:53 pm | Permalink

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 *
*
*