ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

need help, please

Open Hussien110 opened this issue 7 months ago • 2 comments

I'm running Ubuntu on a WSL and I'm facing an issue here can anyone help (venv) h@ubuntu:~$ python -m pip install TA-Lib Collecting TA-Lib Using cached ta_lib-0.6.3.tar.gz (376 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting setuptools (from TA-Lib) Using cached setuptools-78.1.0-py3-none-any.whl.metadata (6.6 kB) Collecting numpy (from TA-Lib) Using cached numpy-2.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB) Using cached numpy-2.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.1 MB) Using cached setuptools-78.1.0-py3-none-any.whl (1.3 MB) Building wheels for collected packages: TA-Lib Building wheel for TA-Lib (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for TA-Lib (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [97 lines of output] :83: UserWarning: Cannot find ta-lib library, installation may fail. /tmp/pip-build-env-m37u7rkp/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsWarning: install_requires overwritten in pyproject.toml (dependencies) corresp(dist, value, root_dir) /tmp/pip-build-env-m37u7rkp/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated. !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: BSD License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    dist._finalize_license_expression()
  /tmp/pip-build-env-m37u7rkp/overlay/lib/python3.12/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: BSD License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running bdist_wheel
  running build
  running build_py
  creating build/lib.linux-x86_64-cpython-312/talib
  copying talib/abstract.py -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/stream.py -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/deprecated.py -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/__init__.py -> build/lib.linux-x86_64-cpython-312/talib
  running egg_info
  writing ta_lib.egg-info/PKG-INFO
  writing dependency_links to ta_lib.egg-info/dependency_links.txt
  writing requirements to ta_lib.egg-info/requires.txt
  writing top-level names to ta_lib.egg-info/top_level.txt
  reading manifest file 'ta_lib.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  adding license file 'AUTHORS'
  writing manifest file 'ta_lib.egg-info/SOURCES.txt'
  copying talib/_abstract.pxi -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/_common.pxi -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/_func.pxi -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/_stream.pxi -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/_ta_lib.c -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/_ta_lib.pyi -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/_ta_lib.pyx -> build/lib.linux-x86_64-cpython-312/talib
  copying talib/py.typed -> build/lib.linux-x86_64-cpython-312/talib
  running build_ext
  building 'talib._ta_lib' extension
  creating build/temp.linux-x86_64-cpython-312/talib
  x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -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/tmp/pip-build-env-m37u7rkp/normal/lib/python3.12/site-packages/numpy/_core/include -I/home/ayanokoji/venv/include -I/usr/include/python3.12 -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-312/talib/_ta_lib.o
  In file included from /tmp/pip-build-env-m37u7rkp/normal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1913,
                   from /tmp/pip-build-env-m37u7rkp/normal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                   from /tmp/pip-build-env-m37u7rkp/normal/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                   from talib/_ta_lib.c:1235:
  /tmp/pip-build-env-m37u7rkp/normal/lib/python3.12/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]
     17 | #warning "Using deprecated NumPy API, disable it with " \
        |  ^~~~~~~
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_18ACCBANDS’:
  talib/_ta_lib.c:13234:40: warning: implicit declaration of function ‘TA_ACCBANDS_Lookback’; did you mean ‘TA_BBANDS_Lookback’? [-Wimplicit-function-declaration]
  13234 |   __pyx_v_lookback = (__pyx_v_begidx + TA_ACCBANDS_Lookback(__pyx_v_timeperiod));
        |                                        ^~~~~~~~~~~~~~~~~~~~
        |                                        TA_BBANDS_Lookback
  talib/_ta_lib.c:13251:21: warning: implicit declaration of function ‘TA_ACCBANDS’; did you mean ‘TA_S_BBANDS’? [-Wimplicit-function-declaration]
  13251 |   __pyx_v_retCode = TA_ACCBANDS(0, __pyx_v_endidx, (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_high)) + __pyx_v_begidx), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_low)) + __pyx_v_begidx), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_close)) + __pyx_v_begidx), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_outrealupperband)) + __pyx_v_lookback), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_outrealmiddleband)) + __pyx_v_lookback), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_outreallowerband)) + __pyx_v_lookback));
        |                     ^~~~~~~~~~~
        |                     TA_S_BBANDS
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_46AVGDEV’:
  talib/_ta_lib.c:16233:40: warning: implicit declaration of function ‘TA_AVGDEV_Lookback’; did you mean ‘TA_STDDEV_Lookback’? [-Wimplicit-function-declaration]
  16233 |   __pyx_v_lookback = (__pyx_v_begidx + TA_AVGDEV_Lookback(__pyx_v_timeperiod));
        |                                        ^~~~~~~~~~~~~~~~~~
        |                                        TA_STDDEV_Lookback
  talib/_ta_lib.c:16240:21: warning: implicit declaration of function ‘TA_AVGDEV’; did you mean ‘TA_STDDEV’? [-Wimplicit-function-declaration]
  16240 |   __pyx_v_retCode = TA_AVGDEV(0, __pyx_v_endidx, (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_real)) + __pyx_v_begidx), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_outreal)) + __pyx_v_lookback));
        |                     ^~~~~~~~~
        |                     TA_STDDEV
  talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_212IMI’:
  talib/_ta_lib.c:35018:40: warning: implicit declaration of function ‘TA_IMI_Lookback’; did you mean ‘TA_WMA_Lookback’? [-Wimplicit-function-declaration]
  35018 |   __pyx_v_lookback = (__pyx_v_begidx + TA_IMI_Lookback(__pyx_v_timeperiod));
        |                                        ^~~~~~~~~~~~~~~
        |                                        TA_WMA_Lookback
  talib/_ta_lib.c:35025:21: warning: implicit declaration of function ‘TA_IMI’; did you mean ‘TA_WMA’? [-Wimplicit-function-declaration]
  35025 |   __pyx_v_retCode = TA_IMI(0, __pyx_v_endidx, (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_open)) + __pyx_v_begidx), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_close)) + __pyx_v_begidx), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (((double *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_outreal)) + __pyx_v_lookback));
        |                     ^~~~~~
        |                     TA_WMA
  x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 build/temp.linux-x86_64-cpython-312/talib/_ta_lib.o -L/usr/lib -L/usr/local/lib -L/usr/lib64 -L/usr/local/lib64 -L/opt/lib -L/opt/local/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/ta-lib/lib -L/usr/lib/x86_64-linux-gnu -Wl,--enable-new-dtags,-rpath,/usr/lib -Wl,--enable-new-dtags,-rpath,/usr/local/lib -Wl,--enable-new-dtags,-rpath,/usr/lib64 -Wl,--enable-new-dtags,-rpath,/usr/local/lib64 -Wl,--enable-new-dtags,-rpath,/opt/lib -Wl,--enable-new-dtags,-rpath,/opt/local/lib -Wl,--enable-new-dtags,-rpath,/opt/homebrew/lib -Wl,--enable-new-dtags,-rpath,/opt/homebrew/opt/ta-lib/lib -lta-lib -o build/lib.linux-x86_64-cpython-312/talib/_ta_lib.cpython-312-x86_64-linux-gnu.so
  /usr/bin/ld: cannot find -lta-lib: No such file or directory
  collect2: error: ld returned 1 exit status
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for TA-Lib Failed to build TA-Lib ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects

Hussien110 avatar Apr 10 '25 03:04 Hussien110

UserWarning: Cannot find ta-lib library, installation may fail.

Please was the installation instructions in the README or the project description.

Thanks,

mrjbq7 avatar Apr 10 '25 04:04 mrjbq7

If you are on linux, you need to first install TA library (instructions are here). Once installed, you can try pip install TA-Lib. Btw, this line is a hint that TA-lib is't installed in your system. /usr/bin/ld: cannot find -lta-lib: No such file or directory

sidml avatar May 26 '25 08:05 sidml