TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.78k stars 1.77k forks source link

symbol not found in flat namespace '_TA_ACOS' on MAC M1. #635

Closed dcgithubaccount closed 10 months ago

dcgithubaccount commented 10 months ago

I am getting below error when i upgraded python to 3.11 from 3.8. The talib was working on M1 before that. I also follwed an old issue on this topic but i couldn't help myself. from ._ta_lib import ( ImportError: dlopen(/Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_TA_ACOS'

I followed below steps brew uninstall ta-lib pip uninstall ta-lib arch -arm64 brew install ta-lib export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include" export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib" pip install TA-Lib otool -L /Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so

/Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1)

Any guidance will be really helpful.

mrjbq7 commented 10 months ago

Typically means you have mixed architectures. If you install arm brew you don’t need “arch -arm64 brew”.Make sure all ta-lib, python, and pip install are using same arch. On Jan 7, 2024, at 12:38 AM, DC @.***> wrote: I am getting below error when i upgraded python to 3.11 from 3.8. The talib was working on M1 before that. I also follwed an old issue on this topic but i couldn't help myself. from ._ta_lib import ( ImportError: dlopen(/Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_TA_ACOS' I followed below steps brew uninstall ta-lib pip uninstall ta-lib arch -arm64 brew install ta-lib export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include" export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib" pip install TA-Lib otool -L /Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so /Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1)

Any guidance will be really helpful.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

mrjbq7 commented 10 months ago

Also instead of “pip install” I recommend “python3.11 -m pip install” so it’s always tied to the Python you want to use. Sometimes the pip script references another Python. On Jan 7, 2024, at 7:56 AM, John Benediktsson @.> wrote:Typically means you have mixed architectures. If you install arm brew you don’t need “arch -arm64 brew”.Make sure all ta-lib, python, and pip install are using same arch. On Jan 7, 2024, at 12:38 AM, DC @.> wrote: I am getting below error when i upgraded python to 3.11 from 3.8. The talib was working on M1 before that. I also follwed an old issue on this topic but i couldn't help myself. from ._ta_lib import ( ImportError: dlopen(/Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_TA_ACOS' I followed below steps brew uninstall ta-lib pip uninstall ta-lib arch -arm64 brew install ta-lib export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include" export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib" pip install TA-Lib otool -L /Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so /Users/deepakchoudhary/anaconda3/lib/python3.11/site-packages/talib/_ta_lib.cpython-311-darwin.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1)

Any guidance will be really helpful.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

dcgithubaccount commented 10 months ago

Thanks for the input. I downloaded the homebrew for Apple Silicon and pip reinstalled with pip install TA-LIB --no-cache-dir and it worked like charm.