ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

brew installs wrong file

Open sharadshekhar opened this issue 5 months ago • 5 comments

Hi

I ran some of code which uses talib after a long time . And import talib is failing with following error

ImportError: dlopen(/Users//miniconda3/envs/vectorbt/lib/python3.10/site-packages/talib/_ta_lib.cpython-310-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/ta-lib/lib/libta_lib.0.dylib

I am on mac with apple silicon and i tried reinstalling ta-lib using brew using following steps

$ brew install ta-lib $ export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include" $ export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib" $ python3 -m pip install ta-lib

But the brew install creates "libta-lib.0.dylib" file rather than "libta_lib.0.dylib" which python import is looking for. The filename has hyphen instead of an underscore .

Any clues how to fix this or what i am doing wrong I checked "libta-lib.dylib" for architecture using command file $(brew --prefix ta-lib)/lib/libta-lib.0.dylib

I get the following response which seems to be correct for my system /opt/homebrew/opt/ta-lib/lib/libta-lib.0.dylib: Mach-O 64-bit dynamically linked shared library arm64

I am able to proceed for now by copying libta-lib.0.dylib to libta_lib.0.dylib . But the brew issue should be fixed. Thanks

sharadshekhar avatar Jun 15 '25 04:06 sharadshekhar