当前位置: 首页 > article >正文

Linux TA_Lib安装

这里写自定义目录标题

  • 安装步骤
    • 下载
    • 解压
    • 进入解压目录
    • 配置
    • 配置
    • 编译安装
    • 安装python ta-lib

安装步骤

下载

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 --prefix=/usr

配置

./configure --prefix=/usr

编译安装

make && sudo make install

安装python ta-lib

pip install TA-Lib

好了,以上是网上的各种步骤,不过都不能安装成功。

gcc -pthread -B /opt/anaconda3/envs/py37/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/tmp/pip-build-env-gkhba782/normal/lib/python3.7/site-packages/numpy/core/include -I/opt/py37_ssh/include -I/opt/anaconda3/envs/py37/include/python3.7m -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-37/talib/_ta_lib.o
      In file included from /tmp/pip-build-env-gkhba782/normal/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969:0,
                       from /tmp/pip-build-env-gkhba782/normal/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-gkhba782/normal/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                       from talib/_ta_lib.c:1235:
      /tmp/pip-build-env-gkhba782/normal/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
       #warning "Using deprecated NumPy API, disable it with " \
        ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_5dtype_8itemsize_itemsize’:
      talib/_ta_lib.c:10083:3: warning: implicit declaration of function ‘PyDataType_ELSIZE’ [-Wimplicit-function-declaration]
         __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_5dtype_9alignment_alignment’:
      talib/_ta_lib.c:10096:3: warning: implicit declaration of function ‘PyDataType_ALIGNMENT’ [-Wimplicit-function-declaration]
         __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_5dtype_6fields_fields’:
      talib/_ta_lib.c:10113:3: warning: implicit declaration of function ‘PyDataType_FIELDS’ [-Wimplicit-function-declaration]
         __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
         ^
      talib/_ta_lib.c:10113:13: warning: assignment makes pointer from integer without a cast [enabled by default]
         __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
                   ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_5dtype_5names_names’:
      talib/_ta_lib.c:10134:3: warning: implicit declaration of function ‘PyDataType_NAMES’ [-Wimplicit-function-declaration]
         __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
         ^
      talib/_ta_lib.c:10134:13: warning: assignment makes pointer from integer without a cast [enabled by default]
         __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
                   ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_5dtype_8subarray_subarray’:
      talib/_ta_lib.c:10151:3: warning: implicit declaration of function ‘PyDataType_SUBARRAY’ [-Wimplicit-function-declaration]
         __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
         ^
      talib/_ta_lib.c:10151:11: warning: assignment makes pointer from integer without a cast [enabled by default]
         __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
                 ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_5dtype_5flags_flags’:
      talib/_ta_lib.c:10164:3: warning: implicit declaration of function ‘PyDataType_FLAGS’ [-Wimplicit-function-declaration]
         __pyx_r = PyDataType_FLAGS(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_9broadcast_7numiter_numiter’:
      talib/_ta_lib.c:10177:3: warning: implicit declaration of function ‘PyArray_MultiIter_NUMITER’ [-Wimplicit-function-declaration]
         __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_9broadcast_4size_size’:
      talib/_ta_lib.c:10190:3: warning: implicit declaration of function ‘PyArray_MultiIter_SIZE’ [-Wimplicit-function-declaration]
         __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_9broadcast_5index_index’:
      talib/_ta_lib.c:10203:3: warning: implicit declaration of function ‘PyArray_MultiIter_INDEX’ [-Wimplicit-function-declaration]
         __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_9broadcast_2nd_nd’:
      talib/_ta_lib.c:10216:3: warning: implicit declaration of function ‘PyArray_MultiIter_NDIM’ [-Wimplicit-function-declaration]
         __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
         ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_9broadcast_10dimensions_dimensions’:
      talib/_ta_lib.c:10229:3: warning: implicit declaration of function ‘PyArray_MultiIter_DIMS’ [-Wimplicit-function-declaration]
         __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
         ^
      talib/_ta_lib.c:10229:11: warning: assignment makes pointer from integer without a cast [enabled by default]
         __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
                 ^
      talib/_ta_lib.c: In function ‘__pyx_f_5numpy_9broadcast_5iters_iters’:
      talib/_ta_lib.c:10242:3: warning: implicit declaration of function ‘PyArray_MultiIter_ITERS’ [-Wimplicit-function-declaration]
         __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
         ^
      talib/_ta_lib.c:10242:11: warning: assignment makes pointer from integer without a cast [enabled by default]
         __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
                 ^
      gcc -pthread -shared -B /opt/anaconda3/envs/py37/compiler_compat -L/opt/anaconda3/envs/py37/lib -Wl,-rpath=/opt/anaconda3/envs/py37/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-cpython-37/talib/_ta_lib.o -L/usr/lib -L/usr/local/lib -L/usr/lib64 -L/usr/local/lib64 -L/opt/lib -L/opt/local/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/ta-lib/lib -Wl,--enable-new-dtags,-R/usr/lib -Wl,--enable-new-dtags,-R/usr/local/lib -Wl,--enable-new-dtags,-R/usr/lib64 -Wl,--enable-new-dtags,-R/usr/local/lib64 -Wl,--enable-new-dtags,-R/opt/lib -Wl,--enable-new-dtags,-R/opt/local/lib -Wl,--enable-new-dtags,-R/opt/homebrew/lib -Wl,--enable-new-dtags,-R/opt/homebrew/opt/ta-lib/lib -lta-lib -o build/lib.linux-x86_64-cpython-37/talib/_ta_lib.cpython-37m-x86_64-linux-gnu.so
      /opt/anaconda3/envs/py37/compiler_compat/ld: cannot find -lta-lib: No such file or directory
      collect2: error: ld returned 1 exit status
      /tmp/pip-install-b792r0m1/ta-lib_21d1a8b28e334a2190c038cdae0be108/setup.py:75: UserWarning: Cannot find ta-lib library, installation may fail.
        warnings.warn('Cannot find ta-lib library, installation may fail.')
      /tmp/pip-build-env-gkhba782/overlay/lib/python3.7/site-packages/setuptools/config/_apply_pyprojecttoml.py:69: SetuptoolsWarning: `install_requires` overwritten in `pyproject.toml` (dependencies)
        corresp(dist, value, root_dir)
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

各种报错,也换了各种版本,解决不了。
然后参考别人,使用conda安装成功了。

##安装方法

conda install -c conda-forge ta-lib

http://www.kler.cn/a/505618.html

相关文章:

  • react中hooks之useEffect 用法总结
  • 【Linux 36】多路转接 - epoll
  • 信凯科技业绩波动明显:毛利率远弱行业,资产负债率偏高
  • 【C语言】线程----同步、互斥、条件变量
  • Java Stream流操作List全攻略:Filter、Sort、GroupBy、Average、Sum实践
  • golang运维开发-gopsutil(2)
  • 智能科技与共情能力加持,哈曼重新定义驾乘体验
  • TCP/IP协议簇及封装与解封装
  • C#中的Span
  • 代码随想录算法训练营第 8 天(字符串1)| 344.反转字符串 541. 反转字符串II 卡码网54.替换数字
  • HTML5 网站模板
  • 2025-1-15-十大经典排序算法 C++与python
  • 网络安全10大漏洞
  • 超燃预告!Origin百图绘制系列即将登场
  • 不同的embedding技术效果评价
  • kafka的listeners和advertised.listeners,配置内外网分流
  • Natural Language-Assisted Multi-modal Medication Recommendation
  • go语言实现UTF8与GB2312内码转换
  • Node.js、Vue 和 React 的关系和区别
  • 一文掌握Docker
  • Ubuntu-Install-Ros2
  • MySQL 排除指定时间内重复记录的解决方案
  • VSCode连接远程docker环境
  • 宝塔面板 申请证书后 仍然提示不安全
  • 神经网络:什么是交叉熵?
  • C++并发编程之异常安全性增强