Installing TA-LIB (Ubuntu)

I am assuming that you have already installed Miniconda on your machine and configured the right environment. For me, my environment has always been py3k so I will have to activate it first by doing

source activate py3k

Now let’s install TA-LIB first.

sudo wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz

tar -xzf ta-lib-0.4.0-src.tar.gz or sudo tar -xzf ta-lib-0.4.0-src.tar.gz

cd ta-lib/

sudo ./configure (if gcc is missing, install it by doing “apt-get install build-essential”)

sudo make

sudo make install

Now let’s install TA-LIB python wrapper

Install wrapper

Pip install https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.zip

At this point, it seems that everything is done.  You can try logging into your python environment (with the right environment) and try to import talib by typing

import talib

and see if it throws an error. If you get an error like below:

Traceback (most recent call last):   File “”, line 1, in ImportError: libta_lib.so.0: cannot open shared object file: No such file or directory

You will need to do the additional steps below.

do either

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

or for a permanent solution, have to add /usr/local/lib to /etc/ld.so.conf as root then run /sbin/ldconfig (also as root)

Advertisements

Author: Zac

Think & Do

One thought on “Installing TA-LIB (Ubuntu)”

  1. It is really helpful. Thanks very much!
    I don’t know why python wrapper is required. I assumed after the step of typing “make install” it should work. But it turns out to be not correctly installing ta-lib

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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