Installing Satchmo on Snow Leopard

Django is my framework of choice for non-CMS web applications, and that makes Satchmo my choice for eCommerce. It’s a great library, even if it does have a million dependencies. On the bright side, I’ve used many of it’s dependencies in other projects, so look at installing these as a chance to learn more about Python.

This tutorial is based on the excellent instructions at the Satchmo Project site.

Installing Dependencies

If you’re going to use Satchmo, you’ve of course got to have Django. See my Django installation tutorial.

Remember how I said that I like to keep Libraries in my user folder? Here’s my first official renege. I don’t want to keep up with all these dependencies, so I’m going to allow easy_install to install these libraries in my Python 2.6 SITE-PACKAGES whenever possible.

Installing easy_install

Here are the official instructions, written for the slightly more advanced user. Here’s what I did:

  1. Download the SetupTools Python egg for our version of Python (2.6, the default on Snow Leopard)
  2. Run the egg as a Shell script with the following Terminal command:
    sudo sh /Users/kevin/Downloads/setuptools-0.6c11-py2.6.egg
  3. Type in your password when your asked for it

That’s it. easy_install is installed as a part of setuptools, and you can run it directly from Terminal by typing ‘easy_install’

Installing the other dependencies

These are generally straightforward with easy_install. Use the command below the name of each library to install. Notes included where I ran into trouble.

Pycrypto

easy_install pycrypto

ReportLab

There’s a link to the 2.5 egg on the Satchmo install site, but that doesn’t help us much. Here’s how to get ReportLab for Python 2.6 (you’ll need GCC, which is a part of XCode):

  1. Download the latest ReportLab tarball from the ReportLab site.
  2. Move the tarball into your user folder and un-tar it
  3. cd
    mv Downloads/ReportLab_2_3.tar.gz ReportLab_2_3.tar.gz
    tar xzvf ReportLab_2_3.tar.gz
  4. Move into the new directory and type the following command to install it:
  5. cd ReportLab_2_3
    python setup.py install

After running this I got the following error:

########## SUMMARY INFO #########
################################################
#Attempting install of _rl_accel, sgmlop & pyHnj
#extensions from '/Users/kevin/ReportLab_2_3/src/rl_addons/rl_accel'
################################################
################################################
#Attempting install of _renderPM
#extensions from '/Users/kevin/ReportLab_2_3/src/rl_addons/renderPM'
# installing without freetype no ttf, sorry!
################################################

Not sure what’s going on here, but I’ll ignore this for now.

TRML2PDF

easy_install http://www.satchmoproject.com/snapshots/trml2pdf-1.2.tar.gz

django-registration

easy_install django-registration

PyYAML

easy_install PyYAML

Python Imaging Library (PIL)

sudo easy_install --find-links=http://download.zope.org/distribution PILwoTk

Django-Threaded-Multihost

  1. Download the django-threaded-multihost tarball from GoSatchmo
  2. Move the tarball into your user folder and un-tar it
  3. cd
    mv Downloads/django-threaded-multihost-1.3-2.tar.gz django-threaded-multihost-1.3-2.tar.gz
    tar xzvf django-threaded-multihost-1.3-2.tar.gz
  4. Move into the new directory and type the following command to install it:
  5. cd django-threaded-multihost-1.3-2
    python setup.py install

Django-App-Plugins

  1. This one’s a little funky. We’re going to need a place for this to live. Make a new directory ‘/Users/kevin/src/django/plugins/’
    mkdir ~/src/django/plugins
  2. Move to the new directory and checkout django-app-plugins from Subversion
  3. cd ~/src/django/plugins
    svn checkout http://django-app-plugins.googlecode.com/svn/trunk/ django-app-plugins-read-only
  4. Create a symbolic link to the SITE-PACKAGES directory from django-app-plugins/app_plugins
    cd /Library/Python/2.6/site-packages/
    ln -s /Users/kevin/src/django/plugins/django-app-plugins-read-only/app_plugins .

SORL-Thumbnail

This package is kept in a Mercurial repository. You’ll have to download and install Mercurial. Here’s the Mercurial Installer for Snow Leopard.

  1. Move to your newly created ‘plugins’ directory and checkout SORL-Thumbnail with Mercurial
    cd ~/src/django/plugins
    hg clone https://sorl-thumbnail.googlecode.com/hg/ sorl-thumbnail
  2. Create a symbolic link to your SITE-PACKAGES directory for SORL-Thumbnail
    cd /Library/Python/2.6/site-packages/
    ln -s /Users/kevin/src/django/plugins/sorl-thumbnail/sorl .

signals-ahoy

  1. Move to your newly created ‘plugins’ directory and checkout signals-ahoy with Mercurial
    cd ~/src/django/plugins
    hg clone http://bitbucket.org/bkroeze/django-signals-ahoy/
  2. Create a symbolic link to your SITE-PACKAGES directory for django-signals-ahoy/signals-ahoy
    cd /Library/Python/2.6/site-packages/
    ln -s /Users/kevin/src/django/plugins/django-signals-ahoy/signals_ahoy .

Sphinx

sudo easy_install sphinx

Docutils

sudo easy_install docutils

Installing Satchmo

Still with me? I want to install Satchmo the same way I installed Django. I’ll be installing it in it’s own directory in ‘src’, though it is technically a plugin. I might be using different versions of Satchmo in the future. I also want to be able to browse the source without too much trouble.

  1. Checkout Satchmo into your ‘src’ directory
    cd ~/src
    mdkir satchmo
    cd satchmo
    hg clone http://bitbucket.org/chris1610/satchmo/ satchmo-trunk
  2. Add ‘satchmo-trunk/satchmo/apps’ to your Python path. I did this by adding it to my .bash_profile. Either edit or create yours, in the root your user directory, to include this line:
    export PYTHONPATH="$PYTHONPATH:/Users/kevin/src/satchmo/satchmo-trunk/satchmo/apps"

At this point, Satchmo is installed. You should be able to import Satchmo from the Python 2.6 interpreter:

>>> import satchmo_store

… and you can now run pre-exisiting Satchmo projects on your iMac.

Leave a Reply

Your email address will not be published.

*
= 3 + 7