pythonpipta-lib

Failling to install ta-lib in Win11


I'm struggling to install ta-lib on my win11 machine. What should've been just a pip install ta-lib and 20 sec later all done, transformed into an endless sequence of errors. I managed to progess with some of them, but now I am stuck with this one and no idea how to move forward:

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\
ta-lib\c\lib /LIBPATH:C:\Users\cris\AppData\Local\Programs\Python\Python310\libs /LIBPATH:C:\Users\cris\AppData\Local\Programs\Python\Python310 /LIBPATH:C:\Users\cris\AppData\Local\Programs\Python\Python310
\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPA
TH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" ta_libc_cdr.lib /EXPORT:PyInit__ta_lib build\temp.win-amd64-cpython-310\Release\talib/_ta_lib.obj /OUT:build\lib.win-amd64-cpython-310\talib\_ta_lib.cp310-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-310\Release\talib\_ta_lib.cp310-win_amd64.lib
         Creating library build\temp.win-amd64-cpython-310\Release\talib\_ta_lib.cp310-win_amd64.lib and object build\temp.win-amd64-cpython-310\Release\talib\_ta_lib.cp310-win_amd64.exp
      _ta_lib.obj : error LNK2001: unresolved external symbol TA_CDLBREAKAWAY_Lookback
      _ta_lib.obj : error LNK2001: unresolved external symbol TA_CDLEVENINGSTAR
.......................... (many similar rows so I deleted all to make error easier to read)
      _ta_lib.obj : error LNK2001: unresolved external symbol TA_BBANDS
      _ta_lib.obj : error LNK2001: unresolved external symbol TA_CDLRISEFALL3METHODS_Lookback
      _ta_lib.obj : error LNK2001: unresolved external symbol TA_GetVersionString
      build\lib.win-amd64-cpython-310\talib\_ta_lib.cp310-win_amd64.pyd : fatal error LNK1120: 339 unresolved externals
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  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

Does anyone know how to escape this?


Solution

  • According to PyPi, To use TA-Lib for python, you need to have the TA-Lib already installed. 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)
    1. Build TA-Lib Library

    You might also try the unofficial windows binaries for both 32-bit and 64-bit.