1

I have the following environment:

Linux Mint17.1 which comes pre-installed with python 2.7.6.

I setup an altinstall for python 3.3.5

Using python 3.3 I created a virtualenv

I am trying to install TA-Lib in the virtual env but am not having any success.

If I try to install with:

./easy_install TA-Lib

I get the following error:

Searching for TA-Lib
Reading https://pypi.python.org/simple/TA-Lib/
Reading http://github.com/mrjbq7/ta-lib
Reading https://github.com/mrjbq7/ta-lib/releases
Best match: TA-Lib 0.4.8
Downloading https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.zip
Processing TA_Lib-0.4.8.zip
Writing /tmp/easy_install-67a3vk/ta-lib-TA_Lib-0.4.8/setup.cfg
Running ta-lib-TA_Lib-0.4.8/setup.py -q bdist_egg --dist-dir/tmp/easy_install-67a3vk/ta-lib-TA_Lib-0.4.8/egg-dist-tmp-w24p9n
/tmp/easy_install-67a3vk/ta-lib-TA_Lib-0.4.8/setup.py:49: UserWarning: Cannot find ta-lib library, installation may fail.
  warnings.warn('Cannot find ta-lib library, installation may fail.')
talib/common.c:314:28: fatal error: ta-lib/ta_defs.h: No such file or directory
 #include "ta-lib/ta_defs.h"
                        ^
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

If I try to install with:

./pip install https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.tar.gz 

I get the following error:

Downloading/unpacking https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.tar.gz
  Downloading TA_Lib-0.4.8.tar.gz (unknown size): 544kB downloaded
  Running setup.py (path:/tmp/pip-rxvyyh-build/setup.py) egg_info for package from https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.tar.gz
/tmp/pip-rxvyyh-build/setup.py:49: UserWarning: Cannot find ta-lib library, installation may fail.
  warnings.warn('Cannot find ta-lib library, installation may fail.')

Installing collected packages: TA-Lib
Running setup.py install for TA-Lib

...removed to make post shorter...

compilation terminated.

/tmp/pip-rxvyyh-build/setup.py:49: UserWarning: Cannot find ta-lib library, installation may fail.

 warnings.warn('Cannot find ta-lib library, installation may fail.')

error: command 'gcc' failed with exit status 1

So basically both approaches result in a final error of:

command 'gcc' failed with exit status 1

I have no problem installing other packages such as numpy, pandas, matplotlib etc in the virtualenv. It is just TA-Lib that is not working.

darkpool
  • 13,822
  • 16
  • 54
  • 89
  • 1
    Looks like you need to make sure the native packages are installed first, and that the include files and libs can be found by gcc. Perhaps this will help: https://tradingprogram.wordpress.com/2014/05/04/installing-ta-lib-ubuntu/ – bimsapi Apr 29 '15 at 14:40

1 Answers1

0

You don't have installed underlying ta-lib library. You can find more info on the project site https://github.com/mrjbq7/ta-lib :

Sometimes installation will produce build errors like this: func.c:256:28: fatal error: ta-lib/ta_libc.h: No such file or directory compilation terminated.

This typically means that it can't find the underlying TA-Lib library, a dependency which needs to be installed.

Dieselist
  • 880
  • 6
  • 15