Install TA-Lib and its corresponding python library in IBM free cloud tier

1.8k Views Asked by At

I am using free tier given by IBM. I want to install TA-Lib and the corresponding python library. I tried following the below URL.

https://github.com/mrjbq7/ta-lib#linux

It seems the IBM environment do not support .deb files. Also, I cannot find yum,dnf, microdnf etc in the env provided.

I tried compiling it from the source, however, on installing python ta-lib, it cannot find the lib and include directory and hence errored out. I tried all the options but to no avail. Below are the commands used. Please note I am executing this in the Jupyter env provided.

!tar -xzf ta-lib-0.4.0-src.tar.gz
%cd ta-lib/
!./configure --prefix=$HOME
!make
!make install

Below is the command I tried for installing python library, but I am getting all kinds of error saying it cannot find gcc, it cannot find header files, it cannot find library etc.

%env TA_LIBRARY_PATH=$HOME/lib
%env TA_INCLUDE_PATH=$HOME/include
!pip install ta-lib

I was able to install ta-lib in google colab successfully using the below commands, however, I cannot use the same here as IBM provides RHEL based system. I cannot use google colab as it crashes very frequently for unknown reasons, hence explored other options and ended up with IBM cloud

!wget https://launchpad.net/~mario-mariomedina/+archive/ubuntu/talib/+files/libta-lib0_0.4.0-oneiric1_amd64.deb -qO libta.deb
!wget https://launchpad.net/~mario-mariomedina/+archive/ubuntu/talib/+files/ta-lib0-dev_0.4.0-oneiric1_amd64.deb -qO ta.deb
!dpkg -i libta.deb ta.deb
!pip install ta-lib

can you please help in installing TA-lib and its corresponding python library?

2

There are 2 best solutions below

2
On BEST ANSWER

I was able to install TA-Lib on Jupyter Notebook with following:

!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
%cd ta-lib/
!./configure --prefix=$HOME
!make
!make install

!TA_LIBRARY_PATH=~/lib TA_INCLUDE_PATH=~/include pip install ta-lib
0
On

pip install ta-lib-binary is definitely the way to go, it worked on Azure. I am not sure if it worked because I tried the other steps before or if it worked by itself.