#Does anyone know how to install ta-lib?

9 messages · Page 1 of 1 (latest)

proven herald
#

I tried to install ta-lib, but I got the following:

#11 31.59 Building wheels for collected packages: TA-Lib
#11 31.59 Building wheel for TA-Lib (pyproject.toml): started

#11 32.74 Building wheel for TA-Lib (pyproject.toml): finished with status 'error'
#11 32.75 Failed to build TA-Lib
#11 32.75 error: subprocess-exited-with-error
#11 32.75
#11 32.75 × Building wheel for TA-Lib (pyproject.toml) did not run successfully.
#11 32.75 │ exit code: 1
#11 32.75 ╰─> [27 lines of output]
#11 32.75 <string>:77: UserWarning: Cannot find ta-lib library, installation may fail.

#11 32.75 ERROR: Failed building wheel for TA-Lib
#11 32.75 ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects

My project ID is ad7c9bbc-1aa3-40e0-ba84-511487698898

austere flameBOT
#

Project ID: ad7c9bbc-1aa3-40e0-ba84-511487698898

sly skiff
#

you'd need to use a dockerfile for this usecase, and there are plenty of sample dockerfiles for installing ta-lib and running a python project

proven herald
#

Great, thank you, successfully installed!

sly skiff
#

and maybe for anyone else that might see this thread and have the same issue, do you think you could post your dockerfile?

proven herald
#

Sure! Here you go:

FROM python:3.9-slim-buster

# Install required packages
RUN apt-get update && \
    apt-get install -y build-essential curl git && \
    apt-get install -y libatlas-base-dev liblapack-dev libopenblas-dev gfortran && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install TA-Lib
RUN curl -L https://downloads.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz | tar xvz && \
    cd ta-lib && \
    ./configure --prefix=/usr && \
    make && \
    make install && \
    cd .. && \
    rm -rf ta-lib

# Set the working directory to /app
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install the required packages
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the container at /app
COPY . .

# Run the command to start the application
CMD ["python", "main.py"]```
hybrid saddle
proven herald
#

@hybrid saddle done!