[[PageOutline(2-3)]] = Trac on Windows = == Install Python == Trac is written in [http://python.org Python], so you will first need to install it. The recommended version of Python at this time is 2.4.3. Many of Trac's dependencies are not available on Windows for Python 2.5, so that version is not yet recommended (but see [wiki:TracOnWindows/Python2.5 a workaround]). Download and run the Python MSI installer: [http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi python-2.4.3.msi] Then add the path to the directory where you chose to install Python to your PATH environment variable. This is important to be able to run the Python executable from any directory in the command line. == Method 1: Experimental All-In-One Installer == This installation script only requires a Python 2.4 installation and will download and install the basic Trac dependencies and optionally the Subversion libraries. It does not always succeed - see the section Troubleshooting below. 1. Download and double-click this script to install Trac: [attachment:trac-0.10.3-win32-install.py?format=raw trac-0.10.3-win32-install.py] 1. Download and run the installer for the Subversion command line tools: [http://subversion.tigris.org/files/documents/15/35379/svn-1.4.2-setup.exe svn-1.4.2-setup.exe] (only if you actually need to interface Trac with Subversion of course; since Trac 0.10, Subversion is not a requirement anymore) 1. Once that's done you can skip ahead to [#GettingStarted Getting Started]. ,,If your network uses a web proxy server, you may have problems with the first step. You could try setting the HTTP_PROXY environment variable to refer to the proxy server. You can set this variable through Control Panel > System > Advanced > Environment Variables, or by using a command prompt from which you then run the script. In the latter example, you would "`SET HTTP_PROXY=http://your.proxy.server:port`" [enter] and then "`trac-0.10.3-win32-install.py`" [enter].,, == Method 2: Using Installers == You need to download and install the following packages: || Mandatory Packages || || || '''[milestone:0.10.3 Trac 0.10.3]''' || [http://ftp.edgewall.com/pub/trac/trac-0.10.3.win32.exe trac-0.10.3.win32.exe] (works for Python 2.4 and 2.3) || || '''ClearSilver''' || [http://www.clearsilver.net/downloads/win32/clearsilver-0.9.14.win32-py2.4.exe clearsilver-0.9.14.win32-py2.4.exe] (or the [http://www.clearsilver.net/downloads/win32/clearsilver-0.9.14.win32-py2.3.exe Python 2.3 version]) || || Optional Packages || (see notes below) || || ''[TracSubversion Subversion]'' || [http://subversion.tigris.org/downloads/svn-python-1.4.2.win32-py2.4.exe svn-python-1.4.2.win32-py2.4.exe] (or the [http://subversion.tigris.org/downloads/svn-python-1.4.2.win32-py2.3.exe Python 2.3 version]) || || ''PySqlite'' || [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.4.exe pysqlite-2.3.2.win32-py2.4.exe] (or the [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.3.exe Python 2.3 version]) || Notes: - You don't necessarily need Subversion. You can use Trac with other [VersioningSystemBackend versioning system backends] or none at all - You need at least one [DatabaseBackend database backend]. If you don't want to use SQLite, see the TracOnWindows/Advanced instructions for other options. If you want to install plugins (WebAdmin and SpamFilter highly recommended!), you also need to install Setuptools manually (see below). == Method 3: Manual Installation == If you don't use the ''All-In-One Installer'', you'll have to download and install a few packages manually. === Setuptools === [http://peak.telecommunity.com/DevCenter/setuptools Setuptools] makes installation of Python software easier by automatically downloading and installing Python packages from the internet. It is also used to find and load [wiki:TracPlugins Trac's plugins]. Download the setuptools installer: [http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py] When the download completes double-click the "ez_setup.py" file from your download folder to install setuptools. === The command line === You'll need to open a command line to install some of the necessary software: 1. Click "Start" > "Run..." (or press Win+R) 1. Type "cmd" and click "Ok" 1. Type "cd \Python24\Scripts" You should now be in the folder "C:\Python24\Scripts" where you can run the "easy_install" command to install the required software. Install the [http://www.clearsilver.net/ ClearSilver] template language: {{{ easy_install -f http://clearsilver.net/downloads clearsilver==0.9.14 }}} Install the [http://pysqlite.org PySqlite] database driver: {{{ easy_install pysqlite }}} If you want to use another database than SQLite, you need to read the TracOnWindows/Advanced instructions. === Subversion (optional) === #Subversion ==== ==== #svntools Trac can integrate with the [http://subversion.tigris.org Subversion] version control software. Follow these steps if you'd like to use Trac with Subversion. You can learn more about how they can integrate from the wiki: TracSubversion. This document covers using the Subversion command line tools, but you can also use the [http://tortoisesvn.net/ TortoiseSVN] Windows GUI. Download and run the installer for the Subversion command line tools: [http://subversion.tigris.org/files/documents/15/35379/svn-1.4.2-setup.exe svn-1.4.2-setup.exe] ==== ==== #svnbindings Go back to your command line to install the Subversion Python library: {{{ easy_install -Z http://subversion.tigris.org/downloads/svn-python-1.4.2.win32-py2.4.exe }}} '''Note:''' the "-Z" option is necessary when installing Subversion so that it is "unzipped". Trac will not be able to access Subversion if it is zipped. === Download Trac === Download and run the latest stable Trac Windows installer: [http://ftp.edgewall.com/pub/trac/trac-0.10.win32.exe trac-0.10.3.win32.exe] '''Note:''' do '''not''' run easy_install on the Trac installer. This is not currently supported and Trac will not work correctly when installed this way. ---- == Getting Started == Ok, now that Trac and all its requirements have been installed you can create your first project and try it out. This example will create the projects in "C:\projects". This is a good default location, but you can put them in another drive or folder if you prefer. Back to the command line: {{{ md \projects cd projects }}} '''Optional:''' if you're using Trac with Subversion you can create a new repository for your source code: {{{ mkdir \projects\svn svnadmin create \projects\svn\my-project }}} === Initialize a new Trac project environment: === First go to the 'Scripts' folder in your Python install directory (e.g. "\Python24\Scripts"), and add the '.py' extension onto the files 'tracd' and 'trac-admin'. Then, from the same folder, type the following at the command line: {{{ mkdir trac \Python24\Scripts\trac-admin.py trac\my-project initenv }}} Follow the interactive prompts to input information about your project. If you are unsure what to put you can simply press "Enter" to accept the default value. '''Subversion users:''' when asked for the "Path to repository" input the folder of the repository you just created: {{{ Path to repository [/path/to/repos]> c:/projects/svn/my-project }}} Note: be sure to include the full path, including the drive letter. == Try it out == Trac includes a standalone webserver called [wiki:TracStandalone tracd]. You can also use Trac with other webservers, but you should first try tracd to make sure everything's set up and working correctly: From the command line, and in the [Python Install]\Scripts directory: {{{ tracd.py -p8000 trac\my-project }}} Open your browser to http://localhost:8000 to test out your new Trac project. Press Ctrl+Break to stop tracd == Troubleshooting == ==== Unsupported version control system "svn" ==== The Subversion library is not installed properly. Be sure you used the "-Z" option with easy_install when [#svnbindings installing] the Subversion bindings. ==== Error: Setup script exited with error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. ==== From [http://www.mail-archive.com/trac-dev@googlegroups.com/msg00997.html] > The problem is that the pre-built Windows binaries for PySQLite are > currently not detected by setuptools, so it is trying to download and > compile the sources which requires a build environment. Unfortunately > this is not particularly common or easy on Windows. I have reported > the problem to the PySQLite developers, so hopefully they will > addresss this soon: http://initd.org/tracker/pysqlite/ticket/191 It appears you can successfully install Trac by following a combination of Method 3: Manual Installation and Method 2: Using Installers, above. The critical step for installing PySQLite is to use the self-installing EXE version, which does not trigger the bogus compile step. As noted above, download and execute the appropriate file: || ''PySqlite'' || [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.4.exe pysqlite-2.3.2.win32-py2.4.exe] (or the [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.3.exe Python 2.3 version]) || ---- See also: the TracOnWindows/Advanced instructions, TracOnWindows/Rewrite for discussing improvements to this page and ["Trac0.9/TracOnWindows"] for the previous version of this document.