Suren Grig
Suren Grig

Reputation: 75

Google Colaboratory Python Installation Error: TA-Lib

Recently, I have attempted to complete a neural network and technical analysis program for the prediction of fluctuations within the financial equities markets available via utilised databases; I am currently utilising the module Quandl for the purposes of financial information retrieval, while the program itself remains within the Google Colaboratory integrated development environment. For the purposes of this project, I have recently attempted to install a Python wrapper for the module TA-Lib, which contains a portion designed for the analysis of candlestick chart patterns; the documentation for the library and page are shown below:

https://github.com/mrjbq7/ta-lib

https://mrjbq7.github.io/ta-lib/func_groups/pattern_recognition.html

Within the Colaboratory editor, I attempted to install the program via the command:

pip install TA-Lib

as specified; however, the integrated development environment provided the following error message:

Collecting TA-Lib
  Using cached https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from TA-Lib) (1.17.5)
Building wheels for collected packages: TA-Lib
  Building wheel for TA-Lib (setup.py) ... error
  ERROR: Failed building wheel for TA-Lib
  Running setup.py clean for TA-Lib
Failed to build TA-Lib
Installing collected packages: TA-Lib
    Running setup.py install for TA-Lib ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-npc2f3yq/TA-Lib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-npc2f3yq/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-oh1la09j/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Is there an alternative method responsible for the avoidance of this inevitable error? If not, is there a method to download this module within Colaboratory which would bypass such processes? Thank you for your assistance.

Upvotes: 1

Views: 1109

Answers (1)

korakot
korakot

Reputation: 40818

Try this

!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
!pip install Ta-Lib
import talib

Upvotes: 2

Related Questions