# Requirements & Installation

## Requirements

As you might have guessed, with all of the magic going on under the hood, there are a few dependencies:

- pyOpenSSL
- python-dateutil
- pytz
- IPy

Additionally, we recommend that you also install ujson as it will speed up the JSON-decoding step considerably, and sphinx if you intend to build the documentation files for offline use.

## Installation

Installation should be easy, though it may take a while to install all of the aforementioned requirements. Using pip is the recommended method.

### Using pip

The quickest and easiest way to install Sagan is to use `pip`:

    $ pip install ripe.atlas.sagan

### From GitHub

If you’re feeling a little more daring and want to use whatever is on GitHub, you can have pip install right from there:

    $ pip install git+https://github.com/RIPE-NCC/ripe.atlas.sagan.git

### From a Tarball

If for some reason you want to just download the source and install it manually, you can always do that too. Simply un-tar the file and run the following in the same directory as `setup.py`.:

    $ python setup.py install

### Troubleshooting

Some setups (like MacOS) have trouble with building the dependencies required for reading SSL certificates. If you don’t care about SSL stuff and only want to use sagan to say, parse traceroute or DNS results, then you can tell the installer to skip building `pyOpenSSL` by doing the following:

    $ SAGAN_WITHOUT_SSL=1 pip install ripe.atlas.sagan

If you do care about SSL and have to use a Mac, then this issue will likely be of assistance. Essentially, you will need to uninstall Xcode (if it’s installed already), then attempt to use `gcc`. This will trigger the OS to ask if you want to install the Xcode compilation tools. Click `install`, and when that’s finished, install Sagan with this command:

> $ CFLAGS=”-I/usr/include” pip install ripe.atlas.sagan