Documentation News Development Download

Pysite »

Installation

Installing Pysite is as easy as unpacking, installing, and configuring a couple of variables. Look here for detailed information about how to install Pysite and set up the appropriate path information to get rolling with the command line tool.

Installing

Installing Pysite depends on whether you've downloaded a binary or a source distribution. Follow the appropriate instructions below.

Using a binary file

Binary distributions of Pysite refer to various packages for some Linux distributions and self-extracting installer programs for Windows. These programs are generally smaller and easier to install than the source distributions, but they don't allow you to check out the source code directly.

To install these files, you will need to follow the installation procedure for binary packages on your system. Under Linux, you'll need to use the external package installer programs (rpm on Red Hat compatible systems, and dpkg, apt-get, or dselect on Debian compatible systems ; there are other programs you can use as well). On Windows, just open up the self-installer executable file.

From source

Pysite uses Python's excellent distutils tools for source distributions and installations. To install a source distribution of Pysite, unpack the distribution tarball or zip file and open up a command terminal. Go to the directory where you unpacked Pysite, and simply run the install script :

  ~/ $ cd src/pysite-x.y.z
  ~/src/pysite-x.y.z/ $ python setup.py

If you need to provide a nonstandard install prefix, or any other nonstandard options, you can provide many command line options to the install script. Use the –help option to see a brief list of available options :

  ~/src/pysite-x.y.z/ $ python setup.py --help

For example, on my machine, I install using this command :

  ~/src/pysite-x.y.z/ $ python setup.py install --prefix=/home/leif/sandbox

Configuring variables

After running the setup script or installing a binary distribution, you might need to add the install location to your PYTHONPATH and PATH environment variables. The process for doing this varies on each platform, but the general concept is the same across platforms.

PYTHONPATH

To set up your PYTHONPATH environment variable, you'll need to add the value PREFIX/lib/pythonX.Y/site-packages to your existing PYTHONPATH. In this value, X.Y stands for the major–minor version of Python you are using (such as 2.2 or 2.3 ; you can find this with sys.prefix[:3] from a Python command line). PREFIX is the install prefix where you installed Pysite. If you did not specify a prefix on the command line, Pysite will be installed using Python's sys.prefix value.

On Linux, using bash, I include the new value in my PYTHONPATH by adding this line to my ~/.bashrc :

  export PYTHONPATH=/home/leif/sandbox/lib/python2.3/site-packages:$PYTHONPATH

Using Windows, you need to open up the system properties dialog, and locate the tab labeled Environment. Add your value to the PYTHONPATH variable, or create a new PYTHONPATH variable if there isn't one already.

PATH

Just like your PYTHONPATH, you'll also need to add a new value to your PATH environment variable so that you can use the Pysite command line tool. Unlike the PYTHONPATH value, however, this time you'll need to add PREFIX/bin to your PATH environment variable. The process for updating this is the same as described above for the PYTHONPATH variable.