Ishan Shah, Rekhit Pachanekar and Gaurav Singh demonstrate how to install Ta-Lib on Windows PC. For instructions on how to install Ta-Lib across platforms using Anaconda prompt see Part I.
Install Ta-Lib on Windows PC
Step 0: We suggest the Anaconda installer for installing Python as it is easier to work with when it comes to programming in Python.
Step 1: Once you have installed Anaconda, you will use the Anaconda prompt window to install the relevant files.
Before we download the Python Ta-Lib files, we have to verify the Python version as well as the Windows System architecture (32-bit or 64-bit) on our computer.
You can find the version installed in your system by simply writing the following code in the Anaconda prompt window: python –version
You will get the output as shown below:
For the windows architecture, you can simply right-click on your “computer” (usually named as “This-PC” or “My Computer”) icon and click properties and your system details will be displayed.
Step 2: We cannot directly use the “pip install” command when it comes to installing Ta-Lib. Thus, we will first install the “whl” file which can be found on this link: https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
The website is a useful resource for a lot of Python extensions, but we are concerned about Ta-Lib installation for now.
You can scroll down to the section where we will find the relevant links, as shown below:
One should note that you should download the file keeping your Python version and Windows architecture (32 bit or 64 bit) in mind. E.g. Since we have the python version 3.7 installed and 64 bit Windows 7 system, we will download the file, “TA_Lib‑0.4.17‑cp37‑cp37m‑win_amd64.whl”.
As you might have guessed “cp37” implies Python version 3.7 and “win_amd64” implies Windows 64 bit operating system.
By default, the “whl” file gets downloaded in the “Downloads” folder. Since we have used Anaconda installer for Python, we will place the file in the same folder location which is shown on the Anaconda prompt.
For eg: C:\Users\rekhit.p
And now comes the easy part.
In the Anaconda prompt, use the pip install command with the file name of the downloaded file.
Since we have downloaded the file, “TA_Lib‑0.4.17‑cp37‑cp37m‑win_amd64.whl”, the command would be, pip install TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
If there is no error, then it implies that we have successfully installed Ta-Lib. You should get a screen with the following messages.
Great! We have just finished installing the Ta-Lib Python library.
But how do we check if it is correctly installed?
On the Anaconda command prompt, you will first type “python” to interpret the program.
We will then type the following command, “import talib” and then press Enter.
If there are no errors, then it means that the python Ta-Lib library has been successfully installed on your computer.
Alternatively, you can also open Jupyter notebook (or Spyder) and try to run the same code to check if the Python Ta-Lib is installed correctly.
In the next installments, the authors will demonstrate how to install Ta-Lib on MacOS.
Visit QuantInsti for additional insight on this topic:
Disclosure: Interactive Brokers
Information posted on IBKR Traders’ Insight that is provided by third-parties and not by Interactive Brokers does NOT constitute a recommendation by Interactive Brokers that you should contract for the services of that third party. Third-party participants who contribute to IBKR Traders’ Insight are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.
This material is from QuantInsti and is being posted with permission from QuantInsti. The views expressed in this material are solely those of the author and/or QuantInsti and IBKR is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
In accordance with EU regulation: The statements in this document shall not be considered as an objective or independent explanation of the matters. Please note that this document (a) has not been prepared in accordance with legal requirements designed to promote the independence of investment research, and (b) is not subject to any prohibition on dealing ahead of the dissemination or publication of investment research.