Skip to content

Installation

Austin Bingham edited this page Mar 17, 2017 · 2 revisions

Installation

Simple installation

For many emacs users, the simplest way to install the server and client is with package.el and the traad-install-server command. Currently the traad package is only hosted in the melpa repository. If you don't already have melpa configured, you can add it to your package sources like this:

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))

See the melpa "Getting Started" page for more details.

Once melpa is in your repository list, you can install traad using package-install:

M-x package-install<RET>traad

or, using elisp:

(package-install "traad")

When that finishes, you can install the Python server component with traad-install-server:

M-x traad-install-server

This will install the server into a virtual environment using virtualenvwrapper.el. The value of venv-location will determine where the virtual environment is created. By default it's ~/.virtualenvs.

The name of the virtual environment is "traad" by default, but you can control this by setting traad-environment-name. traad-install-server will create the virtual environment if necessary, but if the environment already exists then it will be reused.

Supporting multiple versions of traad

If you need to support multiple versions of traad (e.g. Python 2 and Python 3), you can do this by running traad-install-server multiple times with different value for traad-environment-name. Note that you may need to create these environments ahead of time (i.e. without relying on traad-install-server to create them) so that you can create them with the exact Python versions you need.

Once you've got two installations of traad, you can switch between them by changing traad-environment-name and restarting the server.

For example:

;; First install for Python 2
;; This assume that the environment "traad" exists and uses Python2
(setq traad-environment-name "traad")
(traad-install-server)

;; Then install for Python 3
;; This assume that the environment "traad3" exists and uses Python3
(setq traad-environment-name "traad3")
(traad-install-server)

;; To use Python 2
(setq traad-environment-name "traad")
(traad-open "/some/python2/project")
. . . do some refactorings . . .

;; To use Python 3
(setq traad-environment-name "traad3")
(traad-open "/some/python3/project")
. . . do some refactorings . . .

Installation from source

If you can't or don't want to use the emacs package, then you can install directly from the source code.

To install the elisp components, copy traad.el into your emacs load-path and call (require 'traad) somewhere in your emacs startup. You can get more details in the documentation in traad.el itself.

Make sure, of course, to install the traad dependencies as well. They are listed in the Package-Requires header in traad.el.

Clone this wiki locally