共计 1168 个字符,预计需要花费 3 分钟才能阅读完成。
一、创立目录
在目录 /opt/ 下创立两个文件夹 softwares 和 modules,别离用于寄存软件安装包和软件装置后的程序文件,命令如下:
mkdir /opt/softwares
mkdir /opt/modules
二、获取源码
cd /opt/softwares
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
三、解压缩
tar -zxvf ta-lib-0.4.0-src.tar.gz -C /opt/modules/
四、编译装置
cd /opt/modules/ta-lib/
# 编译装置
./configure --prefix=/usr
make && make install
如果在装置时呈现这样的谬误,请装置编译器先:configure: error: no acceptable C compiler found in $PATH
谬误次要是没有 C 编译器.
装置 C 编译器:
[root@localhost sipp-3.5.1]# yum -y install gcc
从新安装文件,问题解决
五、重新安装 TA-Lib 库
重新安装 python 的 TA-Lib 库
pip install TA-Lib
能够看到,曾经装置胜利了:
[root@quant ta-lib]# pip install TA-Lib
Collecting TA-Lib
Using cached TA-Lib-0.4.19.tar.gz (267 kB)
Requirement already satisfied: numpy in /root/anaconda3/lib/python3.6/site-packages (from TA-Lib) (1.14.3)
Building wheels for collected packages: TA-Lib
Building wheel for TA-Lib (setup.py) ... done
Created wheel for TA-Lib: filename=TA_Lib-0.4.19-cp36-cp36m-linux_x86_64.whl size=1738915 sha256=89524f0fd25e4a6d0c123194a4ee32a8fe50457957f4df279c7372e3856dc1ec
Stored in directory: /root/.cache/pip/wheels/56/11/d0/bd214f9bc59dae5004f8f3614139b523882c1ffa3cae90aebd
Successfully built TA-Lib
Installing collected packages: TA-Lib
Successfully installed TA-Lib-0.4.19
[root@quant ta-lib]#
系统配置
ldconfig
正文完