Installing TA-Lib (OS X)

Installing TA-Lib on a Mac OS X is not as straightforward as one may like it to be. Currently my personal development machine is on Mac OS X while my VPS is running Ubuntu LTS 12.04 so I will have to install TA-Lib on both machines and the steps are different for each.

Steps to Install TA-Lib on Mac OS X 10.9

Since I didn’t want to screw up my production environment in my mac, I set up a temporary version using conda.

conda create -n testenv python=3.3 anaconda

and I encountered an error like this.

-> % conda create -n py3 python=3 anaconda
Error: Unsatisfiable package specifications
Hint: the following combinations of packages create a conflict with the
remaining packages:
– numpy 1.7*
– anaconda

Seems like my conda is out of date since I first installed it.

So I could either update anaconda by doing

conda update conda

Or I could hardlink the versions that are already on my machine by doing

conda create -n testenv python=3.3 anaconda=1.8.0 numpy=1.7.1 pandas=0.12.0

After the environment is created, I will activate the env in the current terminal by doing

source activate testenv

Now I am ready to start installing TA-Lib.

Generally I followed the steps listed in here.

1. Install Mac OS X brew install  by opening terminal and run

ruby -e “$(curl -fsSL”

2. Install TA-Lib

brew install ta-lib

3. Because Anaconda already have cython, we can skip this step

4. Install ta-lib wrapper by running this in terminal

sudo pip install ta-lib

By now, since you are in testenv, all necessary packages have been installed. You can check by running

pip list

and see that TA-Lib has been installed.

Now in your python file, you can import talib and run help(talib) to see the help file for TALIB.



Author: Zac

Think & Do

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s