This page describes how to install TurboGears when you do not have an Internet connection or are behind a firewall or proxy that prevents ez_setup or easy_install from working.
If you are trying to install TurboGears and have unrestricted Internet access, then the standard installation instructions can’t be beat. easy_install is a real walk in the park! But if you are behind a restrictive firewall or proxy that prevents TurboGears from installing successfully, then you need another way to install it. Or maybe you just want to download the files once and then install TurboGears on several different machines (via LAN or USB key or whatever). The instructions provided here will let you do that too.
Just follow the steps below and you’ll be enjoying the wonders of TurboGears in no time. :-)
With that in mind, let’s get on with the show!
Many corporate environments use Microsoft Proxy Server to restrict access to the Internet. It uses a proprietary protocol called NTLM for force users to authenticate before they can access the Web. If this is your situation, you can use the following shortcut and skip the rest of these instructions. If not, you can skip this section.
The solution that is recommended in the setuptools installation documentation for dealing with this problem is to use the NTLM Authorization Proxy Server (APS) to handle the NTLM authentication. Here is a quick run down on how to use it:
Once you download and extract APS, modify server.cfg:
Next, open a DOS command window and change to the folder where you extracted APS and run runserver.bat. This should ask for your password.
Now, open another DOS command window and redirect python through your APS proxy, by typing:
Now you can follow the normal install instructions from in that second command window.
Once you are done installing TurboGears, you can close the command window where APS is running.
That’s it! You’re done! :-)
So if you are here, then you are lucky enough to not be behind a Microsoft Proxy Server using NTLM authentication. In which case please keep reading.
TurboGears is installed using the easy_install command. It is part of the setuptools package. If you already have setuptools, you can skip this section. If not, please read on.
The normal way of installing setuptools for the first time is to download the ez_setup.py file and run it. It will go out to the internet and then download and install the setuptools package for you. However if it cannot connect to the internet (which is why you are reading this page), the secret piece of information is that you can download setuptools as a regular python package and install it using the tried and true:
python setup.py install
Just head on over to the setuptools Cheese Shop page and download the zip file.
Setuptools is generally thought of as the biggest barrier to installing TurboGears without the internet because many people only know to use ez_setup.py as the installation option for it. This is understandable as that is the promoted and best way to install it. But as you can see, it is not the only way. Thankfully!
Now that we have setuptools downloaded and can install it, we need to get TurboGears.
TurboGears depends on several other packages and so it has a lot of dependencies. This is a strength (code reuse), but in our case it can be a minor annoyance too.
If you have a way to get unrestricted access to the internet, there is a quick an easy way to just download all of TurboGears and all of it’s dependencies to a directory without installing it. With setuptools installed, make a directory and in it, run:
easy_install -zmaxd . TurboGears
This will connect to the internet and just download TurboGears and all of it’s dependencies to the current directory, without installing anything.
Caveat: The -a option, above, prevents development versions of packages from being downloaded. Sometimes that is what is required. So if the above command fails, saying Could not find suitable distribution and (--always-copy skips system and development eggs), then you cannot use this shortcut and will have to download all the those files manually.
For a more complete explanation of -zmaxd, run:
or check out the setuptools command-line options documentation.
Upgrading: if you are trying to upgrade your TurboGears using this method, use -zmaxUd. The U tells setuptools to upgrade, if possible, over what is currently installed and/or what is currently in your download directory.
If your only access to the internet is restricted so that the above shortcut does not work (or if it does not work for any other reason), you can always download the files manually, one at a time, from the TurboGears download page, or from the TurboGears downloads file list. There are a lot of files there, so here is some explanation of them so you can know which ones you need to care about, but first, a note about platforms, Python versions and eggs:
Generally you want to download one egg file for each package. Some packages are platform-independant, meaning that they run on Windows, Mac and unix-like systems without needing seperate versions. Others packages, however, have to be compiled for different platforms. In this case, precompiled Windows and Mac OS X version are provided. So when choosing your files, if the choice is offered, download files with the following in their names:
Also you only need to choose packages that match your version of Python. So look for:
Finally, egg files are generally preferred over zip or tar.gz files.
We are almost done! :-)
While the TurboGears download page includes TurboGears and all of it’s dependencies, it does not include database driver packages. Which driver(s) you need depend on which database(s) you want to use. At a minimum, you probably want to get the pysqlite package for use during development and probably for use in unit tests too.
As is mentioned in the main TurboGears installation documentation, you can find links to the various supported database driver libraries in the SQLObject documentation.
That’s it! You now have everything you need to install TurboGears without an internet connection. You can now take your laptop on the plane, copy the files to a USB key and take it to work or whatever. The only thing left is how to actually install TurboGears! :-)
Okay, so just to recap:
So to actually do the installation, do the follwing:
Install setuptools and the database drivers, each with:
python setup.py install
Then, in the directory where the TurboGears files are, run:
easy_install -f . TurboGears
The -f . tells easy_install to use the current directory as the source of the packages and not go looking on the internet.
You should also see if there are any extra options or steps to take for your chosen platform by looking in the main installation instructions for your platform.
After that, you should have a nice shiny new TurboGears installed and waiting for you to create the next hottest site on the Web! :-D Good Luck!