在Debian Linux Dockerfile中安装TA-Lib时出错[已关闭]

fdbelqdn  于 2024-01-06  发布在  Docker
关注(0)|答案(1)|浏览(114)

**已关闭。**此问题需要debugging details。目前不接受回答。

编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将帮助其他人回答问题。
6天前关闭
Improve this question
当在继承自python:3.10.13-slim-bookworm的Dockerfile中安装TA-Lib时,我使用这些Dockerfiles作为示例,但仍然出现错误:
https://dev.to/lazypro/build-a-small-ta-lib-container-image-4ca1
https://github.com/deepnox-io/docker-python-ta-lib/blob/main/v0.4.17/python/3.8.1/alpine/3.11/Dockerfile
我看到的错误示例:

Problem with the CMake installation, aborting build. CMake executable is cmake
CMake was unable to find a build program corresponding to "Ninja".

Unit test failures:
Could not build wheels for patchelf, which is required to install pyproject.toml-based projects
FAIL: set-interpreter-long.sh 
FAIL:  set-rpath.sh 
FAIL:  add-rpath.sh

字符串
如何将TA-Lib安装到Dockerfile中?

2cmtqfgy

2cmtqfgy1#

我没有尝试安装anaconda并使用conda安装TA-Lib,但这可能会更容易,正如这里提到的:https://blog.quantinsti.com/install-ta-lib-python/
相反,这里是我完整的Dockerfile。特别是我认为是各种pip和apt-get安装让我的TA-Lib make/install成功:

FROM python:3.10.13-slim-bookworm

WORKDIR /app

ENV PYTHON_TA_LIB_VERSION 0.4.17

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y gcc wget python3-dev musl-dev g++ make cmake autoconf ninja-build vim

COPY . .
RUN pip3 install --upgrade pip
RUN pip3 install setuptools numpy patchelf

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

ENV TA_LIBRARY_PATH="/usr/lib"
ENV TA_INCLUDE_PATH="/usr/include"

RUN pip3 install --global-option=build_ext --global-option="-L/usr/lib" TA-Lib
RUN pip3 install -r requirements.txt

ENV PATH="/usr/bin:$PATH"
ENV LD_LIBRARY_PATH="/usr/lib:$LD_LIBRARY_PATH"
ENV PKG_CONFIG_PATH="/usr/lib/pkgconfig:$PKG_CONFIG_PATH"

ENTRYPOINT ["sleep", "infinity"]

字符串

相关问题