logo

Installing Dexy

Standard Installation

Dexy is a Python package (Python 2.6-2.7 only) and can be installed in the usual way, e.g. pip install dexy. If you are familiar with Python then that's probably all you need to know, although you might want to read the Installing Additional Software section.

If you are unfamiliar with using the command line to install software and run commands, then you should first work through the Command Line Crash Course by Zed Shaw, it's available for free online.

The rest of this section explains in detail how to install Python and Dexy.

Installing Python

Python has to be installed to run Dexy. (You don't need to know the Python language to use Dexy.) First, check if Python is already installed. Python is automatically installed on OSX and many other operating systems. Here is how to check:

python --version

If you get a version number which starts with 2.6 or 2.7, then you are all set.

If you see an error message like command not found, then you don't have Python installed. In that case go to the python website to find an installer for your operating system. Make sure to install Python 2.7 (currently the most recent version available is 2.7.3), and NOT Python 3.

If you already have an older version of Python like 2.5, then dexy will not work unless you install a newer version first. However, this may cause problems for your operating system. You'll need to do some research first, and it might make sense to update your operating system or use a virtual machine.

If you already have Python 2.6 then you should not try to also install Python 2.7 unless you really know what you are doing. This might cause problems for your operating system. Dexy will run just fine on Python 2.6.

If you already have Python 3, then you either need to remove this first (if you are not using it), or research how to install Python 2.7 alongside this.

Using a Virtual Machine

If you have concerns about installing Python, then one option is to create a new virtual machine (you can use the free VirtualBox software) and install Python 2.7 on this, where it will not interfere with your main operating system.

Installing Dexy

Once you get Python installed, then you can install dexy. If you have a tool called pip then this is the preferred way to install python packages:

sudo pip install dexy

You should leave out the word sudo if you are on Windows or if you are installing into a virtualenv.

If you do not have the pip tool, then you probably do have easy_install and you can use that to install dexy:

sudo easy_install dexy

Again, leave out sudo if appropriate.

If you don't have easy_install, then here is how to get it:

curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py

Updating Dexy

In order to get access to new dexy features, performance improvements, and bug fixes, you will want to upgrade your dexy to the latest version from time to time. As with any software, it's possible that an upgrade will cause your dexy project to stop working, although there are lots of tests in place to try to prevent this. So, you should keep your dexy updated, but use common sense and don't update software the day before a huge project is due. Also, learn about Python virtualenvs (see Installing in a Virtualenv below).

If you used pip to install dexy, then you can update by running:

pip install --upgrade dexy

If you used easy_install, then run:

easy_install --upgrade dexy

Check out the next section on virtualenvs for a way to test out a new version of dexy but still be able to revert back to the version you were using if there are problems with it.

Installing in a Virtualenv

You can use virtualenvs to allow you to try out a more recent version of dexy without losing the version that works for you. Here's a brief example.

You can either install virtualenv or download the virtualenv script and run it. We'll do the latter in this example. It's a little less convenient than installing virtualenv and running the virtualenv command, but it has the advantage of not requiring sudo. Grab the virtualenv script:

curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py

Create a new virtualenv:

python virtualenv.py DEXYENV

Then, activate it:

source DEXYENV/bin/activate

Now, with the active virtualenv, install dexy:

pip install dexy

When you are finished working, deactivate the virtualenv:

deactivate

Next time you want to work in this virtualenv, just activate it again:

source DEXYENV/bin/activate

To safely update dexy, you would create a new virtualenv, install the latest dexy (and any other python packages you need) in that env, and test your code. If the newer version of dexy causes problems, then you can just deactivate that virtualenv and go back to using your original virtualenv until you have time to figure out why and update your code.

Source Install

If you want to have the bleeding-edge version of dexy, then you can install dexy from the source code on github. Here's how:

git clone https://github.com/dexy/dexy
cd dexy
pip install -e . # use sudo if not using virtualenv
cd ..

Checking the Installation

After you have installed Dexy, you should be able to run these commands:

dexy version
dexy help

Make sure the dexy version printed out is the one you expected.

Installing Additional Software

When you install dexy, it also installs some extra software which is commonly used in dexy, such as pygments for syntax highlighting, and jinja2 for creating document templates. But, you have to install any other software you would like to use with dexy. Dexy filters can work with many different Python packages and command line tools, but you need to install those packages or tools yourself.

Here are some examples.

If you want dexy to upload files to Amazon S3 for storage, you will need to install the boto package for python.

sudo pip install boto

If you want to use dexy to generate PDF documents from .tex sources (or from other formats that can be converted to .tex), then you will need to install a LaTeX compiler.

Pandoc calls itself a "a universal document converter" and dexy has a pandoc filter allowing you to convert many different types of documents. On ubuntu/debian this can be installed via:

sudo apt-get install -y pandoc

There are other pandoc installers available for other operating systems.

Dexy's filters will try to tell you if you need to install extra software to use them.

Content © 2014 Dr. Ana Nelson | Site Design © Copyright 2011 Andre Gagnon | All Rights Reserved.