Table Of Contents

Downloading and Installing TurboGears

Preface

TurboGears strongly relies on setuptools for its installation and tracking of dependencies. Although setuptools is not included in the standard Python distribution, it is installed by default on many Linux distributions and, if you do not have it yet, can easily be downloaded and installed via the ez_setup.py script.

Note: All commands given below should be run from the command line. The $ at the start of the command line examples denotes the shell prompt. You do not need to enter this. Parts of the given commands in square brackets ([]) are optional and only needed in some situations.

For example, when installing on Unix-like systems as a normal user, you normally need to prefix commands with sudo to run the installation with root privileges.

Important

If you experience problems with the TurboGears download or installation, please write to the mailing list where the community can help you. When you have found a solution for your problem and you think it may be useful for others as well, you can open a documentation ticket.

Method Two: Using tgsetup (the TG 1.0 way)

There are only two steps necessary to install TurboGears, if you already have Python installed and you are ok with installing TurboGears into the system-wide Python site-packages directory. If you don’t have Python installed on your system (or are not sure about it), please visit the Python website.

  1. Download the tgsetup.py script.

  2. Run the script from the command-line:

    $ [sudo] python tgsetup.py
    

We strongly suggest that you also refer to the system-specific installation instructions for details.

Requirements

  • Windows, Mac OS X 10.3/4 or Linux/Unix
  • Python >= 2.4, < 3.x
  • An internet connection
  • About 20-25 MB of disk space, depending on your OS, architecture and filesystem
  • On some systems you need a C compiler, to compile Python C-extensions from some components that are required by TurboGears. See the detailed instructions for your platform for details.
  • If you need to compile extensions, you’ll also need Python header files and libraries. If they are not included in your Python installation, they can usually be installed with a package called python-dev, python-devel or similar
  • (Recommended) A database system (see below)

Note

The recommended Python version to use with TurboGears currently is 2.5.x, but we still support Python 2.4.x. Python 2.6.x is supported from TurboGears version 1.0.9 and 1.1 onwards.

TurboGears does not support Python 3.x yet.

Installing a Database Module

After installing TurboGears you probably also want to install at least one of the object-relational mappers, SQLObject or SQLAlchemy.

You can issue one or both of the following commands to install SQLObject and/or SQLAlchemy:

$ easy_install SQLAlchemy

resp.:

$ easy_install SQLObject

Specific Version Installation

Installing an older version of TurboGears is possible, too. To install a specific version of TurboGears run a command line similar to this one:

$ easy_install -i http://www.turbogears.org/1.1/downloads/1.1.x/index TurboGears==1.1.x

Replace 1.1.x with the number of the TurboGears version which you want to install. This form requires setuptools to be present on your machine. If you don’t have setuptools yet, download and run ez_setup.py to install it:

$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ python ez_setup.py