Coder’s Eye

A site about one of the three passions in my life.

Coder’s Eye header image 2

How to install Cheetah on Dreamhost

January 23rd, 2006 · 2 Comments

CheetahsInstalling Cheetah on Dreamhost’s shared servers is actually a snap, if you have access to a Linux development system. All you have to realize is that the servers are Intel-based Linux systems, Python setup utilities know how to build “dumb” distribution, and that python doesn’t care if you use symlinks to trick it.

Building Cheetah

  1. Skip this step, if you like, by downloading my precompiled Dreamhost-friendly version.
    Download: Cheetah-1.0.linux-i686.tar.gz
    (MD5 Signature: 5e64240ae6dd7eb0ffe92fdde61fe5ea)
  2. To build, go to a Linux computer, preferably Debian, with Python 2.3 installed.
  3. Download Cheetah. I’ve tested this with 1.0. I don’t know about 2.0, probably the same steps would work.
  4. Unpack Cheetah in a temp dir.
    tar xzf Cheetah-1.0.tar.gz
  5. Compile a “dumb distribution”
    cd Cheetah-1.0
    python setup.py bdist_dumb --relative
  6. Copy the compiled distribution to Dreamhost. You’ll find it at “dist/Cheetah-1.0.linux-i686.tar.gz”

Installing Cheetah

  1. Unpack the compiled Cheetah package in some directory. I’ll assume you are going to unpack it in your home directory.
    tar xzf Cheetah-1.0.linux-i686.tar.gz
  2. It will unpack into two directories.
    • lib/python2.3/site-packages/Cheetah — the compiled site packages
    • bin — Cheetah compiler binary
  3. Now, you need to edit your ~/.bash_profile and add a couple lines:
    PATH=$PATH:$HOME/bin
    PYTHONPATH=$PYTHONPATH:$HOME/lib/python2.3/site-packages
    export PATH PYTHONPATH
  4. Now, add the environment variables to your current session.
    source /.bash_profile
  5. At this point, Cheetah should work! Congratulations!
  6. If it compiles all right, but doesn’t work via the web, then you need to make sure your Cheetah dir is available from your web-context pythonpath. The easiest, hackiest, fastest way to do this is to simply make a symlink to Cheetah. This fools Python into seeing the “Cheetah” module in the same place it sees your project files. My domain has its Python cgi files right in the root, so I just did it like this:
    cd ~/mydomain.com
    ln -s ~/lib/python2.3/site-packages/Cheetah .

Please let me know how this works for you, I’ll attempt to help you out if you run into problems.

Technorati Tags: , , , ,

Tags: Libraries · Python

Bookmark this article

del.icio.us:How to install Cheetah on Dreamhost digg:How to install Cheetah on Dreamhost spurl:How to install Cheetah on Dreamhost wists:How to install Cheetah on Dreamhost simpy:How to install Cheetah on Dreamhost newsvine:How to install Cheetah on Dreamhost blinklist:How to install Cheetah on Dreamhost furl:How to install Cheetah on Dreamhost reddit:How to install Cheetah on Dreamhost fark:How to install Cheetah on Dreamhost blogmarks:How to install Cheetah on Dreamhost Y!:How to install Cheetah on Dreamhost smarking:How to install Cheetah on Dreamhost magnolia:How to install Cheetah on Dreamhost segnalo:How to install Cheetah on Dreamhost gifttagging:How to install Cheetah on Dreamhost

2 responses so far ↓

  • 1 Essk // May 22, 2006 at 11:13 am

    Just wanted to say thanks - it works great!

  • 2 name // May 6, 2007 at 10:24 am

    works great for me too

Leave a Comment