WebFaction
Community site: login faq

I am trying to install two software packages with, unfortunately, very similar names. One is a C library called ta-lib and the second is a python wrapper for said C library named TA-Lib. First I installed the C library, ta-lib, from source with:

./configure --prefix=$HOME
make
make install

This seemed to work well and installed ta-lib into: /home/username/src/ta-lib and header files into: /home/username/src/ta-lib/include (ex /home/username/src/ta-lib/include/ta_defs.h)

To install the python wrapper I use: easy_install-2.7 --prefix=$HOME TA-Lib

and get the following errors:

talib/common.c:314:28: error: ta-lib/ta_defs.h: No such file or directory
talib/common.c:315:30: error: ta-lib/ta_common.h: No such file or directory
talib/common.c:316:32: error: ta-lib/ta_abstract.h: No such file or directory
talib/common.c:317:28: error: ta-lib/ta_func.h: No such file or directory
talib/common.c: In function ‘__pyx_f_5talib_6common__ta_check_success’:
talib/common.c:951: error: ‘TA_SUCCESS’ undeclared (first use in this function)
talib/common.c:951: error: (Each undeclared identifier is reported only once
talib/common.c:951: error: for each function it appears in.)
talib/common.c: In function ‘__pyx_pf_5talib_6common_2_ta_initialize’:
talib/common.c:1190: warning: implicit declaration of function ‘TA_Initialize’
talib/common.c: In function ‘__pyx_pf_5talib_6common_4_ta_shutdown’:
talib/common.c:1266: warning: implicit declaration of function ‘TA_Shutdown’
talib/common.c: In function ‘initcommon’:
talib/common.c:1912: warning: implicit declaration of function ‘TA_GetVersionString’
talib/common.c:1912: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/local/include/python2.7/stringobject.h:63: note: expected ‘const char *’ but argument is of type ‘int’
error: Setup script exited with error: command 'gcc' failed with exit status 1

It appears that the install script is looking for the C ta-lib header files in ta-lib/ instead of ta-lib/include. By the way, this install works properly on my local machine using the default install dir /usr.

Can anyone provide some tips on what I can try to solve this problem?

asked 22 Jan '14, 16:52

Roland
21510
accept rate: 0%


Try setting your CPPFLAGS and/or LDFLAGS environment variables. Some guidance is available here: Depending on Non-Standard Libraries and Headers Causes Errors

permanent link

answered 22 Jan '14, 18:11

seanf
12.2k41836
accept rate: 37%

Setting CPPFLAGS solved the above problem but then there were more dependency failures. Those were solved by setting LDFLAGS.

  • export CPPFLAGS="-I$HOME/include $CPPFLAGS"
  • export LDFLAGS="-L$HOME/lib $LDFLAGS"

However, I cannot import the talib library from the python shell. I get:

File "<stdin>", line 1, in <module> File "build/bdist.linux-x86_64/egg/talib/__init__.py", line 4, in <module> # File "build/bdist.linux-x86_64/egg/talib/common.py", line 7, in <module> File "build/bdist.linux-x86_64/egg/talib/common.py", line 6, in __bootstrap__ ImportError: libta_lib.so.0: cannot open shared object file: No such file or directory

(22 Jan '14, 18:44) Roland

At runtime, try:

export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
(22 Jan '14, 18:47) seanf

Solved! Thank-you, Sean.

(22 Jan '14, 19:14) Roland
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×52
×16
×4

question asked: 22 Jan '14, 16:52

question was seen: 3,924 times

last updated: 22 Jan '14, 19:14

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM