Fix error when install ta-lib:

Posted on May 07, 2024 at 10:07 PM


ta-lib is a popular open-source to calculatte technical analysis indicators in finace anaylysis. But when you install

pip installl ta-lib

The following error occurs

ERROR: Could not build wheels for ta-lib, which is required to install pyproject.toml-based projects

The reason is that ta-lib python wrapper depending on the ta-lib c++ library. You need manually install. So how to install it?

  • Download ta-lib c/c++ source code ta-lib-0.4.0-src.tar.gz (Do not download from github c/c++ source code, which misses configure. Then following the steps to install. You will be successfull (Test in Apple Mac M1 and Ubuntu).

unzip
cd ta-lib
./configure --prefix=/usr/local
make
sudo make install
pip install ta-lib

Some initial comparison: ta-lib-python vs ta ta

ta is easy to install. But it supports only 43 technical indicators. As comparison, ta-lib supports 200 indicators.