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 and its dependencies 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.

Method Three: Using setuptools (without virtualenv)

If you have setuptools already installed and don’t want to use virtualenv but install TurboGears and its dependencies directly into your site-packages directory, you can do it as follows:

$ easy_install -i http://www.turbogears.org/1.5/downloads/current/index TurboGears

Installing an older version of TurboGears is always possible since we keep all our files online. To install a specific version of TurboGears run a command line similar to this one:

$ easy_install -i http://www.turbogears.org/1.5/downloads/1.5.x/index TurboGears==1.5.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

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

Requirements

  • Windows, Mac OS X 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 above)

Note

The recommended Python version to use with TurboGears 1.5 currently is 2.6, but we still support Python 2.4, 2.5 and also support Python 2.7. TurboGears does not support Python 3.x yet.