ImportError: libta_lib.so.0: cannot open shared object file: No such file or directory

Viewed 11597

i'm trying to import talib, but I'm getting this error:

ImportError: libta_lib.so.0: cannot open shared object file: No such file or directory

When I start python like this:

LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" python

import talib works.

How can I turn this solution into a fixed one?

4 Answers

I had the same issue. See below for what I did to fix it.

installing

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=/usr
make
Sudo make install
pip install numpy

If you don't have it installed

pip install TA-Lib 

if you do have it installed

pip install --upgrade --force-reinstall TA-Lib

hope this helps someone :)

add the foldername to ldconfig:

sudo -s 
echo "include /usr/local/lib" >> /etc/ld.so.conf
ldconfig 

For me, following worked:

/usr/local/lib
  1. put above line to /etc/ld.so.conf
  2. execute sudo ldconfig.

You may well find that ldconfig is already configured to search '/usr/local/lib', and in this case, you only need to reload it, using sudo ldconfig.

(I would post this as a comment, but insufficient reputation.)

Related