TA-LIB package installing issues

Hello team, 



I was wondering if you share additional guidelines for how to successfully install the Ta-lib package in the Terminal (for mac in my case if that makes a difference).

I tried the following commands but still facing issues at the moment:



% pip install TA-Lib

% conda install -c conda-forge ta-lib

(% pip install TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl)

 

Last login: Thu May  2 12:36:51 on ttys001
(base) adrien_m3pro@Adriens-MacBook-Pro ~ % pip install TA-Lib
Collecting TA-Lib
  Downloading TA-Lib-0.4.28.tar.gz (357 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 357.1/357.1 kB 3.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /opt/anaconda3/lib/python3.11/site-packages (from TA-Lib) (1.26.4)
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
  ╰─> [21 lines of output]
      <string>:77: UserWarning: Cannot find ta-lib library, installation may fail.
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-11.1-arm64-cpython-311
      creating build/lib.macosx-11.1-arm64-cpython-311/talib
      copying talib/abstract.py -> build/lib.macosx-11.1-arm64-cpython-311/talib
      copying talib/deprecated.py -> build/lib.macosx-11.1-arm64-cpython-311/talib
      copying talib/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/talib
      copying talib/stream.py -> build/lib.macosx-11.1-arm64-cpython-311/talib
      running build_ext
      building 'talib._ta_lib' extension
      creating build/temp.macosx-11.1-arm64-cpython-311
      creating build/temp.macosx-11.1-arm64-cpython-311/talib
      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/anaconda3/include -arch arm64 -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/private/tmp/pip-build-env-jr_vye86/normal/lib/python3.11/site-packages/numpy/core/include -I/opt/anaconda3/include/python3.11 -c talib/_ta_lib.c -o build/temp.macosx-11.1-arm64-cpython-311/talib/_ta_lib.o
      talib/_ta_lib.c:1082:10: fatal error: 'ta-lib/ta_defs.h' file not found
      #include "ta-lib/ta_defs.h"
               ^~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' 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
(base) adrien_m3pro@Adriens-MacBook-Pro ~ % conda install -c conda-forge ta-lib
Channels:
 - conda-forge
 - defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: | warning  libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - package ta-lib-0.4.19-py310ha11ecec_4 requires python >=3.10,<3.11.0a0 *_cpython, but none of the providers can be installed

Could not solve for environment specs
The following packages are incompatible
├─ pin-1 is installable and it requires
│  └─ python 3.11.* , which can be installed;
└─ ta-lib is not installable because there are no viable options
   ├─ ta-lib [0.4.19|0.4.28] would require
   │  └─ python >=3.10,<3.11.0a0 *_cpython, which conflicts with any installable versions previously reported;
   ├─ ta-lib [0.4.19|0.4.28] would require
   │  └─ python >=3.8,<3.9.0a0 *_cpython, which conflicts with any installable versions previously reported;
   └─ ta-lib [0.4.19|0.4.28] would require
      └─ python >=3.9,<3.10.0a0 *_cpython, which conflicts with any installable versions previously reported.

(base) adrien_m3pro@Adriens-MacBook-Pro ~ % pip install TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl
WARNING: Requirement 'TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl' looks like a filename, but the file does not exist
ERROR: TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
(base) adrien_m3pro@Adriens-MacBook-Pro ~ %                                                   

Hi Adrien,



This was discussed and resolved. You can refer to this link if you want to revisit the process.

Thanks Akshay.