linux 在对接机上安装Talib

5uzkadbs  于 2023-03-17  发布在  Linux
关注(0)|答案(2)|浏览(303)
FROM python:3
USER root

RUN apt-get update
RUN apt-get -y install locales && \
    localedef -f UTF-8 -i ja_JP ja_JP.UTF-8

RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
  tar -xvzf ta-lib-0.4.0-src.tar.gz && \
  cd ta-lib/ && \
  ./configure --prefix=/usr && \
  make && \
  make install
RUN pip install TA-Lib
RUN rm -R ta-lib ta-lib-0.4.0-src.tar.gz

ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
ENV TERM xterm

ADD . /code
WORKDIR /code

RUN apt-get install -y vim less
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install -r requirements.txt
version: "3"
services:
  python3:
    restart: always
    build: .
    container_name: "binancepython3"
    working_dir: /root/
    tty: true
    volumes:
      - ./opt:/root/opt
pandas
requests
ccxt == 1.81.77

我正在尝试在docker上安装talib,但是我遇到了下面的错误,你能教我怎么解决吗?
问题是由环境引起的吗?我应该用anaconda代替python:3吗?

#7 3.276 configure: error: cannot guess build type; you must specify one
------
executor failed running [/bin/sh -c wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz &&   tar -xvzf ta-lib-0.4.0-src.tar.gz &&   cd ta-lib/ &&   ./configure --prefix=/usr &&   make &&   make install]: exit code: 1
ERROR: Service 'python3' failed to build : Build failed
8tntrjer

8tntrjer1#

增加:

./configure --build=aarch64-unknown-linux-gnu

更多信息:https://stackoverflow.com/a/68025766/1145929

mspsb9vt

mspsb9vt2#

使用continuumio/miniconda 3图像代替。下面是对我有效的方法:
从连续/微型摄像机3
ENV丙酮未缓冲1
WORKDIR /应用程序目录
复制要求. txt要求. txt
运行是|conda安装-c conda-锻造ta-lib
运行pip 3安装-r要求. txt
复制。
暴露8000
[“Python”,manage.py“运行服务器”,“0.0.0.0:8000”]

相关问题