Python, Eggs and Dreamhost
Dreamhost, my web host, does not yet support Python2.5, and one can’t install Python eggs into Dreamhost’s own Python installations. The solution? I just installed a custom build of Python2.5 into my $HOME/opt directory. The following is the script I created to automate that process:
# Obtain Python2.5 and unpack
mkdir $HOME/downloads/
cd $HOME/downloads/
wget http://www.python.org/ftp/python/2.5/Python-2.5.tgz
tar -zxvf Python-2.5.tgz# Creating the location under which python (and other apps) are to be installed.
mkdir $HOME/opt# Go into the Python2.5 directory, make && make install the thing
cd Python-2.5
./configure –prefix=$HOME/opt –enable-unicode=ucs4
make && make install# Create a bin directory for Python, and link the bin to the real executable
mkdir -p $HOME/bin/python/bin
ln -s $HOME/opt/bin/python $HOME/bin/python/bin/python
After the installation, I edited the bash_profile file to add the bin path:
export PATH=$HOME/bin/python/bin:$HOME/opt/bin:$PATH
Now with a custom installation of Python, I can use eggs to manage my Django projects’ library dependencies.
[...] After installing my own custom Python build, I went back and tweaked how Django ran on my Dreamhost account. My previous Django installation experience is still mostly valid. I just figured I could “upgrade” the installation to take advantage of Python 2.5 and eggs. [...]
Pingback by BadPopcorn » Django and Dreamhost, Take 2 — November 13, 2006 @ 2:14 pm
[...] Google. You know, I really don’t know how people lived pre-Googs. In any case, I found this blog posting describing exactly what I wanted to do. Thanks Ben! Since I’m not a big fan of running one [...]
Pingback by Ryan Kanno: The diary of an Enginerd in Hawaii » Custom Python installation for Django on Dreamhost — August 19, 2007 @ 11:09 pm