我已经使用以下命令成功安装了
TA-Lib
:
brew install ta-lib
pip3 install ta-lib
之后,命令
pip3 list
已显示TA-Lib
版本。
TA-Lib 0.4.21
但是,当我尝试
import talib
时,出现了错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/talib/__init__.py", line 52, in <module>
from ._ta_lib import (
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so, 2): Symbol not found: _TA_ACOS
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so
Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so
您能建议如何解决这个问题吗?
我也遇到了同样的问题,我解决了。 系统是MacOS M1 |蟒蛇3.9 我尝试了
brew install
,但pip install
不起作用,talib无法导入。
遇到同样的问题,努力绕了3个小时。几乎尝试了论坛中你能找到的每一个动作..最后我不得不为 m-chips 安装brew 如何在 M1 mac 上安装 homebrew 并使用命令卸载 /usr/local 下的其他brew
/usr/local/bin/brew list | xargs /usr/local/bin/brew uninstall --force
&
/usr/local/bin/brew install --force /usr/local/bin/brew cleanup --force sudo rm -rf /usr/local/Homebrew sudo rm -rf /usr/local/Caskroom sudo rm -rf /usr/local/Cellar sudo rm -rf /usr/local/var/homebrew sudo rm -rf /usr/local/etc/bash_completion.d sudo rm -rf /usr/local/lib/pkgconfig sudo rm -rf /usr/local/opt sudo rm -rf /usr/local/share/doc/homebrew sudo rm -rf /usr/local/share/man/man1/brew.1 sudo rm -rf /usr/local/share/man/man1/brew-cask.1 sudo rm -rf /usr/local/share/zsh/site-functions/_brew sudo rm -rf /usr/local/share/zsh/site-functions/_brew_cask sudo rm -rf /usr/local/share/zsh/site-functions/_brew_cask sudo rm -rf /usr/local/bin/brew sudo rm -rf /usr/local/bin/brew-cask
之后
python3 -m pip install --no-cache-dir ta-lib
为我做的