| 48 | |
| 49 | == Install Trac from source using `easy_install` |
| 50 | |
| 51 | Using the python-typical setup at the top of the source directory also works. You can obtain the source for a .tar.gz or .zip file corresponding to a release (e.g. `Trac-1.0.tar.gz`) from the [trac:TracDownload] page, or you can get the source directly from the repository. See [trac:TracRepositories#OfficialSubversionrepository TracRepositories] for details. |
| 52 | |
| 53 | {{{#!sh |
| 54 | $ python ./setup.py install |
| 55 | }}} |
| 56 | |
| 57 | ''You will need root permissions or equivalent for this step.'' |
| 58 | |
| 59 | This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory |
| 60 | of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as `htdocs` and `templates`. |
| 61 | |
| 62 | If you install from source and want to make Trac available in other languages, make sure Babel is installed. Only then, perform the `install` (or simply redo the `install` once again afterwards if you realize Babel was not yet installed): |
| 63 | {{{#!sh |
| 64 | $ python ./setup.py install |
| 65 | }}} |
| 66 | Alternatively, you can run `bdist_egg` and copy the .egg from `dist/` to the place of your choice, or you can create a Windows installer (`bdist_wininst`). |
| 67 | |
| 68 | === Advanced `easy_install` Options |
| 69 | |
| 70 | To install Trac to a custom location, or find out about other advanced installation options, run: |
| 71 | {{{#!sh |
| 72 | $ easy_install --help |
| 73 | }}} |
| 74 | |
| 75 | Also see [http://docs.python.org/2/install/index.html Installing Python Modules] for detailed information. |
| 76 | |
| 77 | Specifically, you might be interested in: |
| 78 | {{{#!sh |
| 79 | $ easy_install --prefix=/path/to/installdir |
| 80 | }}} |
| 81 | or, if installing Trac on a Mac OS X system: |
| 82 | {{{#!sh |
| 83 | $ easy_install --prefix=/usr/local --install-dir=/Library/Python/2.6/site-packages |
| 84 | }}} |
| 85 | |
| 86 | {{{#!div style="border: 1pt dotted; margin: 1em" |
| 87 | **Mac OS X Note:** On Mac OS X 10.6, running `easy_install trac` will install into `/usr/local` and `/Library/Python/2.6/site-packages` by default. |
| 88 | |
| 89 | The `tracd` and `trac-admin` commands will be placed in `/usr/local/bin` and will install the Trac libraries and dependencies into `/Library/Python/2.6/site-packages`, which is Apple's preferred location for third-party Python application installations. |
| 90 | }}} |
| 91 | |