centos安装 TA-Lib
Posted lovely可爱欧辰
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos安装 TA-Lib相关的知识,希望对你有一定的参考价值。
奇葩问题
问题一:gcc 编译器未安装
问题二:
command 'gcc' failed with exit status 1
问题三:
Traceback (most recent call last):
File "run1.py", line 3, in <module>
from vnpy.trader.engine import MainEngine, LogEngine
File "/home/fireaiserver/VNPY/vnpy/trader/engine.py", line 32, in <module>
from .setting import SETTINGS
File "/home/fireaiserver/VNPY/vnpy/trader/setting.py", line 7, in <module>
from .utility import load_json
File "/home/fireaiserver/VNPY/vnpy/trader/utility.py", line 10, in <module>
import talib
File "/home/fireaiserver/anaconda3/envs/vnpy/lib/python3.6/site-packages/talib/__init__.py", line 43, in <module>
from ._ta_lib import (
ImportError: libta_lib.so.0: cannot open shared object file: No such file or directory
解决方案
问题一:
yum -y install gcc gcc-c++ kernel-devel //安装gcc、c++编译器以及内核文件
问题二:
下载 ta_lib 依赖包
wget --no-check-certificate https://downloads.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz
解压并编译安装
tar -xvf ta-lib-0.4.0-src.tar.gz
cd ta-lib
./configure
sudo make
sudo make install
安装 TA-Lib
问题三: 配置 /usr/local/lib
sudo echo "/usr/local/lib" >> /etc/ld.so.conf
sudo ldconfig
以上是关于centos安装 TA-Lib的主要内容,如果未能解决你的问题,请参考以下文章