我无法使用Ta-lib,这是一个在来自Oracle cloud的始终免费的ARM64(AArch64) Amepere处理器和Ubuntu20的python3中用于技术分析的模块。为了验证我遵循的步骤是否正确,我设法在安装了AMD处理器的X64虚拟机上成功安装。因此,我tink AArch64可能需要一些调整来安装Ta-lib。
我使用的步骤如下(https://sachsenhofer.io/install-ta-lib-ubuntu-server/)
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
./configure
make
sudo make install
我在用于./configure
的Ubuntu终端中发现的错误如下
<pre>
ta-lib-0.4.0-src.tar.gz 100%[=====================================================================================================>] 1.27M --.-KB/s in 0.03s
2021-09-02 09:32:28 (47.0 MB/s) - ‘ta-lib-0.4.0-src.tar.gz’ saved [1330299/1330299]
<font color="#55FF55"><b>ubuntu@algo3</b></font>:<font color="#5555FF"><b>~</b></font>$ tar -xzf ta-lib-0.4.0-src.tar.gz
<font color="#55FF55"><b>ubuntu@algo3</b></font>:<font color="#5555FF"><b>~</b></font>$ cd ta-lib/
<font color="#55FF55"><b>ubuntu@algo3</b></font>:<font color="#5555FF"><b>~/ta-lib</b></font>$ sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... ./config.guess: unable to guess system type
This script, last modified 2006-07-02, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2006-07-02
uname -m = aarch64
uname -r = 5.8.0-1037-oracle
uname -s = Linux
uname -v = #38~20.04.1-Ubuntu SMP Fri Jul 16 00:56:44 UTC 2021
/usr/bin/uname -p = aarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = aarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.8.0-1037-oracle
UNAME_SYSTEM = Linux
UNAME_VERSION = #38~20.04.1-Ubuntu SMP Fri Jul 16 00:56:44 UTC 2021
configure: error: cannot guess build type; you must specify one
<font color="#55FF55"><b>ubuntu@algo3</b></font>:<font color="#5555FF"><b>~/ta-lib</b></font>$
</pre>
发布于 2021-10-07 13:06:35
事实证明,安装了TA-Lib的x86_64版本会干扰arm64版本的TA-Lib的安装。请先使用brew卸载TA-Lib的x86_64版本,然后再安装TA-Lib的arm64版本。
一些可能的调试:
➜ which brew
/opt/homebrew/bin/brew
➜ brew --prefix ta-lib
/opt/homebrew/opt/ta-lib
➜ file $(brew --prefix ta-lib)/lib/libta_lib.dylib
/opt/homebrew/opt/ta-lib/lib/libta_lib.dylib: Mach-O 64-bit dynamically linked shared library arm64
➜ which python3
/opt/homebrew/bin/python3
➜ file /opt/homebrew/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so
/opt/homebrew/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so: Mach-O 64-bit bundle arm64
➜ ~ python3
Python 3.9.2 (default, Mar 26 2021, 15:28:17)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import talib
>>> talib.__ta_version__
b'0.4.0 (Nov 25 2020 22:11:03)'
https://stackoverflow.com/questions/69028110
复制相似问题