Reputation: 23
1. Download working well: !wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz !tar -xzvf ta-lib-0.4.0-src.tar.gz %cd ta-lib !./configure --prefix=/usr !make !make install
2. The installation has an error. Fails to install. It has been working well.
!pip install TA-Lib
Collecting TA-Lib Using cached ta_lib-0.6.0.tar.gz (371 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from TA-Lib) (75.1.0) Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from TA-Lib) (1.26.4) Building wheels for collected packages: TA-Lib error: subprocess-exited-with-error
× Building wheel for TA-Lib (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for TA-Lib (pyproject.toml) ... error ERROR: Failed building wheel for TA-Lib Failed to build TA-Lib ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (TA-Lib)
How do I go about proper installation?
Please note:
Alternatively, This is also not working:
!wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz !tar -xzvf ta-lib-0.4.0-src.tar.gz %cd ta-lib !./configure --prefix=/usr !make !make install %cd .. !pip install TA-Lib
I also tried to install it in VSC, but still had the same error:
note: This error originates from a subprocess, and is likely not a problem with pip. h "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ 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 pylem with pip.project.toml-based projects
Upvotes: 1
Views: 231
Reputation: 40908
url = 'https://anaconda.org/conda-forge/libta-lib/0.4.0/download/linux-64/libta-lib-0.4.0-h166bdaf_1.tar.bz2'
!curl -L $url | tar xj -C /usr/lib/x86_64-linux-gnu/ lib --strip-components=1
!pip install conda-package-handling
!wget https://anaconda.org/conda-forge/ta-lib/0.5.1/download/linux-64/ta-lib-0.5.1-py311h9ecbd09_0.conda
!cph x ta-lib-0.5.1-py311h9ecbd09_0.conda
!mv ./ta-lib-0.5.1-py311h9ecbd09_0/lib/python3.11/site-packages/talib /usr/local/lib/python3.11/dist-packages/
import talib
Upvotes: 0
Reputation: 1
It took me several hours to fix this bug. There is probably the problem with pip trying to install TA-Lib automatically. So I had to install manually the earlier version of TA-Lib from the source code. Execute the following code and restart the session:
!wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz !tar xvzf ta-lib-0.5.0-src.tar.gz import os os.chdir('ta-lib') # Can't use !cd in co-lab !./configure --prefix=/usr !make !make install os.chdir('../') !pip install TA-Lib==0.4.37 --no-cache-dir --force
I hope this will help you, until they fix the error.
Upvotes: 0