how to install Ta-lib with python 3.11 in Windows?
Asked Answered
P

6

6

TA-Lib windows distribution from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib, but only support to 3.10. How to install Ta-lib with python 3.11 in Windows?

Instructions from the README for installing on Windows:

Download ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib.

This is a 32-bit binary release. If you want to use 64-bit Python, you will need to build a 64-bit version of the library. Some unofficial (and unsupported) instructions for building on 64-bit Windows 10, here for reference:

  1. Download and Unzip ta-lib-0.4.0-msvc.zip
  2. Move the Unzipped Folder ta-lib to C:\
  3. Download and Install Visual Studio Community (2015 or later)
    • Remember to Select [Visual C++] Feature
  4. Build TA-Lib Library
    • From Windows Start Menu, Start [VS2015 x64 Native Tools Command Prompt]
    • Move to C:\ta-lib\c\make\cdr\win32\msvc
    • Build the Library nmake

But then:

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 pyproject.toml-based projects
Pugging answered 16/2, 2023 at 15:4 Comment(1)
Please edit your question and post the full text of any errors or tracebacks.Thumbprint
Z
4

The only solution that worked for me is this: https://github.com/afnhsn/TA-Lib_x64

  1. Download "ta-lib x64.zip" from github above. Extract zip file to C:\, so it looks like this C:\ta-lib
  2. Download Visual C++ build tools 2022: https://aka.ms/vs/17/release/vs_buildtools.exe
  3. Install Visual C++ build tools: https://mcmap.net/q/181173/-how-to-install-visual-c-build-tools
  4. Install ta-lib: pip install ta-lib
Zackaryzacks answered 19/2, 2023 at 20:23 Comment(0)
T
4

It should be noted that installing a wheel made for an older Python version (e.g. 3.10), but the correct architecture (e.g. win64) is probably going to work for you. This can be done using pip install <path to .whl file>. The main downside of this approach is that the prebuilt wheel you're using could be somewhat outdated.

Here's what I did to build it myself on a "clean" system:

  1. Install the following 3 components from the VS2022 installer: enter image description here

  2. Follow the instructions for building using nmake quoted in the OP. [src]

  3. pip install TA-Lib

If you don't want to do any of that, I've uploaded my built wheel here.

Torrlow answered 25/8, 2023 at 8:35 Comment(0)
P
3

As of today, I found this link to get the latest .whl files for Windows OS here. Other methods failed, only the wheel file that exactly matched the Python version and Windows binary worked. In my case, Python 3.11 on a Win x64. Hope this helps!

Postaxial answered 27/12, 2023 at 12:12 Comment(0)
W
1

On Windows

Solution that works

  1. Download the whl file for your python version (3.11 and 3.12 exist in this thread) https://github.com/TA-Lib/ta-lib-python/issues/127#issuecomment-1793716236
  2. Unzip the downloaded file
  3. Go to directory where you have the file and run pip install "the downloaded .whl file"

Example: pip install TA_Lib-0.4.28-cp312-cp312-win_amd64.whl

Weatherly answered 7/4 at 9:31 Comment(0)
G
0

You have to find the correct wheel file for TA-Lib and Python 3.11. I currently am trying to find the same file. 3.10 is the latest I have seen

https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib

Gadoid answered 18/2, 2023 at 23:5 Comment(0)
K
-3

This works

python3 -m pip install TA-Lib
Kafka answered 17/3, 2023 at 8:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.