Trac is a most excellent bugtracking, wiki, version control, <insert other things relevant to development> system. However, the default instructions for installing Trac require root (superuser) privs, which isn't possible if you use a shared server (I do) or don't have sudo on the box you're trying things out on (or for whatever reason, want to isolate your Trac install). Fortunately, the fix is easy; use virtualenv.

I haven't seen these instructions up anywhere, so I'm posting them here (if someone would like these on the Trac wiki, feel free to port them over, or to ask me to). Thanks to Noah (coderanger) who suggested using virtualenv (by Ian) early on, saving a lot of unnecessary pain.

First, if you don't have root and your default python install (type "python -V" at your prompt) is earlier than python2.4, you'll want to custom-install Python2.5 or some other more recent version. Instructions on how to do that are here. After you've got python2.4 or later, you can proceed.


# get the code...
wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.0.tar.gz #md5=fb86aabdfc2033612b936cf08ad811ec
tar zxfv virtualenv-1.0.tar.gz # untar/unzip
mv virtualenv-1.0/virtualenv.py ./ # copy out the python files
rm -r virtualenv-1.0 # not strictly necessary, but cleans stuff up
rm virtualenv-1.0.tar.gz # ditto
python virtualenv.py . # to install virtualenv in your current directory

(If you want to install virtualenv somewhere else, run python virtualenv.py somewhere_else as the last command instead.) You should now have a /bin and a /lib in your current directory. Now you can follow the Trac installation guide, using the stuff in ./bin/python.


bin/easy_install Pygments
bin/easy_install Genshi
bin/easy_install Trac

That's it. And now you can create your project wherever you like (replace /path/to/yourproject with whatever you want - /home/yourusername/nameofproject or whatnot) and test it...


bin/trac-admin /path/to/yourproject initenv
bin/tracd --port 8000 /path/to/yourproject

and then go to http://localhost:8000 or http://your-url.com:8000 to check it out. Follow the instructions on the Trac wiki guide thereafter to customize Trac and deploy it on a "real" (non-tracd) webserver - just use your virtualenv's bin/python python-instance.

Suggestions, corrections, and clarifications are, as usual, welcome.