Close Navigation
Learn more about IBKR accounts
How to Install Ta-Lib in Python – Part II

How to Install Ta-Lib in Python – Part II

Posted June 23, 2021
Ishan Shah, Rekhit Pachanekar and Gaurav Singh
QuantInsti

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:
https://blog.quantinsti.com/install-ta-lib-python/

Disclosure: Interactive Brokers

Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus 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 its permission. The views expressed in this material are solely those of the author and/or QuantInsti and Interactive Brokers 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 buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. 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.

IBKR Campus Newsletters

This website uses cookies to collect usage information in order to offer a better browsing experience. By browsing this site or by clicking on the "ACCEPT COOKIES" button you accept our Cookie Policy.