1.1. Installing Ambry¶
Ambry is a complex package that has dependencies on a lot of other code, some of which are hard to build from source, so there are a few different ways to install it. Note that, unless you are installing a dedicated machine, or using a seperate python installation like Anaconda, you should install Ambry in a virtual environment.
1.1.1. Virtual environment¶
To use a virtual environment, install the Python virtualenv module. The virtualenv website has complete instructions, but generally it is as easy as:
First, if you haven’t worked in python before, you should install pip:
$ easy_install pip
Then, install the virtualenv package to create virtual environments.
$ pip install virtualenv
Create the virtualenv and activate it:
$ virtualenv ambry $ source ambry/bin/activate
Setting up and running virtual environments requires remembering a few special commands, so it’s more convenient to use virtualenvwrapper, which provides the workon command to make using virtualenvironments easier. See the documentation for complete instructions.
1.1.2. Mac OS X¶
Although it doesn’t need to use it to run in all cases, the Ambry imports Postgres modules, so you have to install the Postgres binaries. On Mac OS X, There are a few ways to do that:
- Install Postgres via Anaconda
- Install Postgres via Homebrew, which also requires XCode to be installed
The easiest way is to get postgres is to install Anaconda, although this will also install a new Python binary. ( Use Homebrew if you want to avoid using the Anaconda version of Python. ) Visit the Continuum Analytics downloads page <http://continuum.io/downloads> and install it. After installing Anaconda, open a new Terminal window ( an old one won’t have the path set correctly. ) In the new terminal window, you should now be running the python included with Anaconda, which you can check with:
$ which python /Users/eric/anaconda/bin/python
Since the Anaconda python is seperate from the main system Python, you don’t really need to create a virtual environment, if you are only using Anaconda for Ambry.
Install the psycopg2 package via conda, which will also install the postgres binary libraries.
$ conda install psycopg2
After installing Postgres, you can install Ambry.
pip install ambry
126.96.36.199. Removing Anaconda¶
Anaconda alters your shell path by adding to the
~/.bash_profile file. If you edit the file to
remove the statements that Anaconda added, future shells will use the default python.
1.1.3. Linux, Ubuntu¶
For Ubuntu 14.04 or later, use this script to install the dependencies and the Ambry package.
$ sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/CivicKnowledge/ambry/master/support/install/install-ubuntu.sh)"
If you’ve created a fresh Ubuntu install, you’ll probably also have to update and install curl. Here’s one line that will take care of everything.
$ apt-get update && apt-get install -y curl && \ sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/CivicKnowledge/ambry/master/support/install/install-ubuntu.sh)"
Follow up with Post Install to create your configuration files and check the integrity of the installation.