centos安装 TA-Lib

与世无争的帅哥 提交于 2020-01-18 01:29:45

奇葩问题

问题一: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++编译器以及内核文件 

问题二:

  1. 下载 ta_lib 依赖包
    wget https://downloads.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz
    
  2. 解压并编译安装
    tar -xvf ta-lib-0.4.0-src.tar.gz
    cd ta-lib
    ./configure 
    sudo make 
    sudo make install 
    
  3. 安装 TA-Lib
      pip install TA-Lib
    

问题三: 配置 /usr/local/lib

sudo echo "/usr/local/lib" >> /etc/ld.so.conf 
sudo ldconfig
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!