skip to Main Content

I am trying to install the TA-Lib python wrapper in linux debian, I have already installed the required c library ta-lib, but when I run pip install TA-Lib, it fails. In the documentation to install the wrapper there is not mention of the error I am receiving, below is the whole output of ‘pip install TA-Lib’

Created temporary directory: /tmp/pip-ephem-wheel-cache-t3NPMw
Created temporary directory: /tmp/pip-req-tracker-2MFlu1
Created requirements tracker '/tmp/pip-req-tracker-2MFlu1'
Created temporary directory: /tmp/pip-install-NViOgN
Collecting TA-Lib
  1 location(s) to search for versions of TA-Lib:
  * https://pypi.org/simple/ta-lib/
  Getting page https://pypi.org/simple/ta-lib/
  Looking up "https://pypi.org/simple/ta-lib/" in the cache
  Current age based on date: 374
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 0
  Starting new HTTPS connection (1): pypi.org:443
  https://pypi.org:443 "GET /simple/ta-lib/ HTTP/1.1" 304 0
  Analyzing links from page https://pypi.org/simple/ta-lib/
    Found link https://files.pythonhosted.org/packages/87/d3/59094a1816233adcb27159d4b0b54982eb5bde4513dba4d4f2e4f0467e3c/TA-Lib-0.4.9.tar.gz#sha256=102f7f763a90ae72dcbe9f842ec7e656007c0b4aa234899425f8be226e9c1cb9 (from https://pypi.org/simple/ta-lib/), version: 0.4.9
    Found link https://files.pythonhosted.org/packages/0d/85/d80e736cafde6239eef73dabf2b5d5db53ccb5552526a1c4b127caafe917/TA-Lib-0.4.9.zip#sha256=0601c6f7007c3cf4f585dd6fd45df55720ab38bcd91f19abb807cbcbe9f5b42a (from https://pypi.org/simple/ta-lib/), version: 0.4.9
    Found link https://files.pythonhosted.org/packages/23/ac/da20341c64ae569535eaa786f849a598015ea77e5b6d957d3c674a35b01c/TA-Lib-0.4.14.tar.gz#sha256=375edf46c146d4d7b35e305bd06096acc7dd1728ff6dff2058cc21289f9b18a9 (from https://pypi.org/simple/ta-lib/), version: 0.4.14
    Found link https://files.pythonhosted.org/packages/89/27/c3f1be143905daf12ca4c9a52e4f5cc538a97ad01b9cd0123fe7643666fd/TA-Lib-0.4.15.tar.gz#sha256=811d0ba366d243e2b158de1f5678f53171741e802319f8e0e7840e721fb51c0e (from https://pypi.org/simple/ta-lib/), version: 0.4.15
    Found link https://files.pythonhosted.org/packages/0a/7d/a5f64eadbac6cf7ee41f9ae88fcfee1ff0824ffea529efe1e5cb2dd7e60b/TA-Lib-0.4.16.tar.gz#sha256=555f5d9e6720ef935669c1f404a7179091ae35869c6435957709a7059b9fd1d7 (from https://pypi.org/simple/ta-lib/), version: 0.4.16
    Found link https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz#sha256=16ab1e33c547fe72c10c28b02f6ae342fbcc7eef6a49ba961c639a6020aba56a (from https://pypi.org/simple/ta-lib/), version: 0.4.17
    Found link https://files.pythonhosted.org/packages/d7/15/ebf1a6ebcf7580dc53e342979c7425affc38ef272bc10a7f4565ee87b394/TA-Lib-0.4.18.tar.gz#sha256=261d88fbca4b1923b37e0aad23512bc9b9245726c187344e432ee6a4a9a134a8 (from https://pypi.org/simple/ta-lib/), version: 0.4.18
    Found link https://files.pythonhosted.org/packages/ac/cf/681911aa31e04ba171ab4d523a412f4a746e30d3eacb1738799d181e028b/TA-Lib-0.4.19.tar.gz#sha256=5303227898f8f08baecb4d3b8767c85891b65b21f481a3ecbaa6e901c3531db5 (from https://pypi.org/simple/ta-lib/), version: 0.4.19
    Found link https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz#sha256=89947bf28d265bb632060bdba77eb4f4d0e812c4e918c7377f129b4a3ee9a8e9 (from https://pypi.org/simple/ta-lib/), version: 0.4.20
  Using version 0.4.20 (newest of versions: 0.4.9, 0.4.14, 0.4.15, 0.4.16, 0.4.17, 0.4.18, 0.4.19, 0.4.20)
  Created temporary directory: /tmp/pip-unpack-LC5U47
  Looking up "https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz" in the cache
  Current age based on date: 349425
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 349425
  Using cached https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz
  Downloading from URL https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz#sha256=89947bf28d265bb632060bdba77eb4f4d0e812c4e918c7377f129b4a3ee9a8e9 (from https://pypi.org/simple/ta-lib/)
  Added TA-Lib from https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz#sha256=89947bf28d265bb632060bdba77eb4f4d0e812c4e918c7377f129b4a3ee9a8e9 to build tracker '/tmp/pip-req-tracker-2MFlu1'
  Running setup.py (path:/tmp/pip-install-NViOgN/TA-Lib/setup.py) egg_info for package TA-Lib
    Running command python setup.py egg_info
    running egg_info
    creating pip-egg-info/TA_Lib.egg-info
    writing requirements to pip-egg-info/TA_Lib.egg-info/requires.txt
    writing pip-egg-info/TA_Lib.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/TA_Lib.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/TA_Lib.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/TA_Lib.egg-info/SOURCES.txt'
    reading manifest file 'pip-egg-info/TA_Lib.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'pip-egg-info/TA_Lib.egg-info/SOURCES.txt'
  Source in /tmp/pip-install-NViOgN/TA-Lib has version 0.4.20, which satisfies requirement TA-Lib from https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz#sha256=89947bf28d265bb632060bdba77eb4f4d0e812c4e918c7377f129b4a3ee9a8e9
  Removed TA-Lib from https://files.pythonhosted.org/packages/1f/fd/cb3b4255f2639e3478d75750d06e0d8f3342d7f8f28e8d855198769d3ede/TA-Lib-0.4.20.tar.gz#sha256=89947bf28d265bb632060bdba77eb4f4d0e812c4e918c7377f129b4a3ee9a8e9 from build tracker '/tmp/pip-req-tracker-2MFlu1'
Requirement already satisfied: numpy in /home/admin/.local/lib/python2.7/site-packages (from TA-Lib) (1.16.6)
Building wheels for collected packages: TA-Lib
  Created temporary directory: /tmp/pip-wheel-Y0aivl
  Running setup.py bdist_wheel for TA-Lib ...   Destination directory: /tmp/pip-wheel-Y0aivl
  Running command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NViOgN/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-Y0aivl --python-tag cp27
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/talib
  copying talib/deprecated.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/test_pandas.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/__init__.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/abstract.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/stream.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/test_stream.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/test_func.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/test_data.py -> build/lib.linux-x86_64-2.7/talib
  copying talib/test_abstract.py -> build/lib.linux-x86_64-2.7/talib
  running build_ext
  building 'talib._ta_lib' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/talib
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/home/admin/.local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c talib/_ta_lib.c -o build/temp.linux-x86_64-2.7/talib/_ta_lib.o
  In file included from /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
                   from /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from talib/_ta_lib.c:620:
  /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   #warning "Using deprecated NumPy API, disable it with " 
    ^~~~~~~
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_348_ta_getFuncInfo’:
  talib/_ta_lib.c:38240:104: warning: passing argument 2 of ‘TA_GetFuncInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
     __pyx_v_retCode = TA_GetFuncInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_info));
                                                                                                         ~^~~~~~~~~~~~~~
  In file included from talib/_ta_lib.c:615:
  /usr/include/ta-lib/ta_abstract.h:211:48: note: expected ‘const TA_FuncInfo **’ {aka ‘const struct TA_FuncInfo **’} but argument is of type ‘TA_FuncInfo **’ {aka ‘struct TA_FuncInfo **’}
                              const TA_FuncInfo **funcInfo );
                              ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_350_ta_getInputParameterInfo’:
  talib/_ta_lib.c:38511:127: warning: passing argument 3 of ‘TA_GetInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
     __pyx_v_retCode = TA_GetInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info));
                                                                                                                                ~^~~~~~~~~~~~~~
  In file included from talib/_ta_lib.c:615:
  /usr/include/ta-lib/ta_abstract.h:442:68: note: expected ‘const TA_InputParameterInfo **’ {aka ‘const struct TA_InputParameterInfo **’} but argument is of type ‘TA_InputParameterInfo **’ {aka ‘struct TA_InputParameterInfo **’}
                                        const TA_InputParameterInfo **info );
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_352_ta_getOptInputParameterInfo’:
  talib/_ta_lib.c:38761:130: warning: passing argument 3 of ‘TA_GetOptInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
     __pyx_v_retCode = TA_GetOptInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info));
                                                                                                                                   ~^~~~~~~~~~~~~~
  In file included from talib/_ta_lib.c:615:
  /usr/include/ta-lib/ta_abstract.h:446:74: note: expected ‘const TA_OptInputParameterInfo **’ {aka ‘const struct TA_OptInputParameterInfo **’} but argument is of type ‘TA_OptInputParameterInfo **’ {aka ‘struct TA_OptInputParameterInfo **’}
                                           const TA_OptInputParameterInfo **info );
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_354_ta_getOutputParameterInfo’:
  talib/_ta_lib.c:39007:128: warning: passing argument 3 of ‘TA_GetOutputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
     __pyx_v_retCode = TA_GetOutputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info));
                                                                                                                                 ~^~~~~~~~~~~~~~
  In file included from talib/_ta_lib.c:615:
  /usr/include/ta-lib/ta_abstract.h:450:70: note: expected ‘const TA_OutputParameterInfo **’ {aka ‘const struct TA_OutputParameterInfo **’} but argument is of type ‘TA_OutputParameterInfo **’ {aka ‘struct TA_OutputParameterInfo **’}
                                         const TA_OutputParameterInfo **info );
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  talib/_ta_lib.c: In function ‘__pyx_f_5talib_7_ta_lib___ta_getFuncHandle’:
  talib/_ta_lib.c:39606:126: warning: passing argument 2 of ‘TA_GetFuncHandle’ from incompatible pointer type [-Wincompatible-pointer-types]
     __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetFuncHandle, TA_GetFuncHandle(__pyx_v_function_name, (&__pyx_v_handle)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 720, __pyx_L1_error)
                                                                                                                               ~^~~~~~~~~~~~~~~~
  In file included from talib/_ta_lib.c:615:
  /usr/include/ta-lib/ta_abstract.h:155:52: note: expected ‘const TA_FuncHandle **’ {aka ‘const unsigned int **’} but argument is of type ‘TA_FuncHandle **’ {aka ‘unsigned int **’}
                                const TA_FuncHandle **handle );
                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
  virtual memory exhausted: Cannot allocate memory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
error
  Failed building wheel for TA-Lib
  Running setup.py clean for TA-Lib
  Running command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NViOgN/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" clean --all
  running clean
  removing 'build/temp.linux-x86_64-2.7' (and everything under it)
  removing 'build/lib.linux-x86_64-2.7' (and everything under it)
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-2.7' does not exist -- can't clean it
  removing 'build'
Failed to build TA-Lib
Installing collected packages: TA-Lib
  Created temporary directory: /tmp/pip-record-PMKdIH
  Running setup.py install for TA-Lib ...     Running command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NViOgN/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-PMKdIH/install-record.txt --single-version-externally-managed --prefix /usr --compile
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/talib
    copying talib/deprecated.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/test_pandas.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/__init__.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/abstract.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/stream.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/test_stream.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/test_func.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/test_data.py -> build/lib.linux-x86_64-2.7/talib
    copying talib/test_abstract.py -> build/lib.linux-x86_64-2.7/talib
    running build_ext
    building 'talib._ta_lib' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/talib
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/home/admin/.local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c talib/_ta_lib.c -o build/temp.linux-x86_64-2.7/talib/_ta_lib.o
    In file included from /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
                     from /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from talib/_ta_lib.c:620:
    /home/admin/.local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it with " 
      ^~~~~~~
    talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_348_ta_getFuncInfo’:
    talib/_ta_lib.c:38240:104: warning: passing argument 2 of ‘TA_GetFuncInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
       __pyx_v_retCode = TA_GetFuncInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_info));
                                                                                                           ~^~~~~~~~~~~~~~
    In file included from talib/_ta_lib.c:615:
    /usr/include/ta-lib/ta_abstract.h:211:48: note: expected ‘const TA_FuncInfo **’ {aka ‘const struct TA_FuncInfo **’} but argument is of type ‘TA_FuncInfo **’ {aka ‘struct TA_FuncInfo **’}
                                const TA_FuncInfo **funcInfo );
                                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
    talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_350_ta_getInputParameterInfo’:
    talib/_ta_lib.c:38511:127: warning: passing argument 3 of ‘TA_GetInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
       __pyx_v_retCode = TA_GetInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info));
                                                                                                                                  ~^~~~~~~~~~~~~~
    In file included from talib/_ta_lib.c:615:
    /usr/include/ta-lib/ta_abstract.h:442:68: note: expected ‘const TA_InputParameterInfo **’ {aka ‘const struct TA_InputParameterInfo **’} but argument is of type ‘TA_InputParameterInfo **’ {aka ‘struct TA_InputParameterInfo **’}
                                          const TA_InputParameterInfo **info );
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
    talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_352_ta_getOptInputParameterInfo’:
    talib/_ta_lib.c:38761:130: warning: passing argument 3 of ‘TA_GetOptInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
       __pyx_v_retCode = TA_GetOptInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info));
                                                                                                                                     ~^~~~~~~~~~~~~~
    In file included from talib/_ta_lib.c:615:
    /usr/include/ta-lib/ta_abstract.h:446:74: note: expected ‘const TA_OptInputParameterInfo **’ {aka ‘const struct TA_OptInputParameterInfo **’} but argument is of type ‘TA_OptInputParameterInfo **’ {aka ‘struct TA_OptInputParameterInfo **’}
                                             const TA_OptInputParameterInfo **info );
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
    talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_354_ta_getOutputParameterInfo’:
    talib/_ta_lib.c:39007:128: warning: passing argument 3 of ‘TA_GetOutputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types]
       __pyx_v_retCode = TA_GetOutputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info));
                                                                                                                                   ~^~~~~~~~~~~~~~
    In file included from talib/_ta_lib.c:615:
    /usr/include/ta-lib/ta_abstract.h:450:70: note: expected ‘const TA_OutputParameterInfo **’ {aka ‘const struct TA_OutputParameterInfo **’} but argument is of type ‘TA_OutputParameterInfo **’ {aka ‘struct TA_OutputParameterInfo **’}
                                           const TA_OutputParameterInfo **info );
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
    talib/_ta_lib.c: In function ‘__pyx_f_5talib_7_ta_lib___ta_getFuncHandle’:
    talib/_ta_lib.c:39606:126: warning: passing argument 2 of ‘TA_GetFuncHandle’ from incompatible pointer type [-Wincompatible-pointer-types]
       __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetFuncHandle, TA_GetFuncHandle(__pyx_v_function_name, (&__pyx_v_handle)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 720, __pyx_L1_error)
                                                                                                                                 ~^~~~~~~~~~~~~~~~
    In file included from talib/_ta_lib.c:615:
    /usr/include/ta-lib/ta_abstract.h:155:52: note: expected ‘const TA_FuncHandle **’ {aka ‘const unsigned int **’} but argument is of type ‘TA_FuncHandle **’ {aka ‘unsigned int **’}
                                  const TA_FuncHandle **handle );
                                  ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
    virtual memory exhausted: Cannot allocate memory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
error
Cleaning up...
  Removing source in /tmp/pip-install-NViOgN/TA-Lib
Removed build tracker '/tmp/pip-req-tracker-2MFlu1'
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NViOgN/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-PMKdIH/install-record.txt --single-version-externally-managed --prefix /usr --compile" failed with error code 1 in /tmp/pip-install-NViOgN/TA-Lib/
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 386, in run
    use_user_site=options.use_user_site,
  File "/usr/lib/python2.7/dist-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
    **kwargs
  File "/usr/lib/python2.7/dist-packages/pip/_internal/req/req_install.py", line 791, in install
    spinner=spinner,
  File "/usr/lib/python2.7/dist-packages/pip/_internal/utils/misc.py", line 723, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NViOgN/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-PMKdIH/install-record.txt --single-version-externally-managed --prefix /usr --compile" failed with error code 1 in /tmp/pip-install-NViOgN/TA-Lib/

”’

It seems to me that there are two problems: the wheel for TA-Lib can’t be built and the second one is that pip is trying to build one from source code but there is not enough memory. However, there is also to be another error that is making these kinds of errors :

/usr/include/ta-lib/ta_abstract.h:211:48: note: expected ‘const TA_FuncInfo **’ {aka ‘const struct TA_FuncInfo **’} but argument is of type ‘TA_FuncInfo **’ {aka ‘struct TA_FuncInfo **’}
                              const TA_FuncInfo **funcInfo );

I would like to know what error should I focus to fix

2

Answers


  1. Here’s a way to install ta-lib form source without using pip

    wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
    if [ ! -f "ta-lib/CHANGELOG.TXT" ]; then
      tar zxvf ta-lib-0.4.0-src.tar.gz
      cd ta-lib && sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h && ./configure && make && sudo make install && cd ..
    else
      echo "TA-lib already installed, skipping download and build."
      cd ta-lib && sudo make install && cd ..
    fi
    

    If that doesn’t work you could try this

    if [ -z "$1" ]; then
      INSTALL_LOC=/usr/local
    else
      INSTALL_LOC=${1}
    fi
    echo "Installing to ${INSTALL_LOC}"
    if [ ! -f "${INSTALL_LOC}/lib/libta_lib.a" ]; then
      tar zxvf ta-lib-0.4.0-src.tar.gz
      cd ta-lib 
      && sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h 
      && curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -o config.guess 
      && curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -o config.sub 
      && ./configure --prefix=${INSTALL_LOC}/ 
      && make -j$(nproc) 
      && which sudo && sudo make install || make install 
      && cd ..
    else
      echo "TA-lib already installed, skipping installation"
    fi
    
    
    Login or Signup to reply.
  2. You can install it through conda:

    Install conda (How to install conda.) then create quantra env:

    ./anaconda3/bin/conda init 
     source ~/.bashrc 
     conda create -n quantra python=3.9.2 -y 
     conda activate quantra
    

    Replace python=3.9.2 with your python3 --version

    Finally:

    conda install -c conda-forge ta-lib
    

    check it:

    python3
    import talib
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search