nad
nad

Reputation: 2860

Lightgbm inside docker libgomp.so.1: cannot open shared object file

I have LightGBM installed in my mac and tested earlier for a different project.

Now I am inside a docker with python 3.6 on my mac. As soon as I add import lightgbm as lgbm in my Flask application, I get error

OSError: libgomp.so.1: cannot open shared object file: No such file or directory

What is going on? Can anyone please suggest?

Upvotes: 11

Views: 8231

Answers (2)

Galuoises
Galuoises

Reputation: 3283

Depending on the image yo use you may need a c++ compiler, together with libgomp1 too. The issue is that Lightgbm is coded in c++ indeed and the base image of your dockerfile may not have all dependencies installed by default (while your mac has).

Following these links

( https://raw.githubusercontent.com/Microsoft/LightGBM/master/docker/dockerfile-cli) (https://github.com/microsoft/LightGBM/issues/2223)

the solution would be to add to the dockerfile

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        ca-certificates \
        cmake \
        build-essential \
        gcc \
        g++ \
        git && \
    rm -rf /var/lib/apt/lists/* && \
    apt-get install libgomp1 -y

Upvotes: 2

Vignesh Venkataraman
Vignesh Venkataraman

Reputation: 81

This worked for me, include it in your dockerfile

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get -y install curl
RUN apt-get install libgomp1

Source: https://github.com/microsoft/LightGBM/issues/2223#issuecomment-499788066

Upvotes: 8

Related Questions