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
3 Trackbacks/Pingbacks
[...] Upgrade python on dreamhost (tags: howto python dreamhost django) [...]
[...] 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 [...]
[...] 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