UserWarning: Starting from version 2.2.1, the library file in distribution wheels for macOS is built by the Apple Clang (Xcode_8.3.3) compiler

Viewed 308

I have built a prediction app using lightgbm algorithm and fastapi in my Windows Machine, my app was perfectly 100% running back then. Until, I changed to mac machine and tried to run the app again and got this message:

/Users/bhaskoromuthohar/dev/cm/credit-scoring/.venv/lib/python3.7/site-packages/lightgbm/__init__.py:48: UserWarning: Starting from version 2.2.1, the library file in distribution wheels for macOS is built by the Apple Clang (Xcode_8.3.3) compiler.
This means that in case of installing LightGBM from PyPI via the ``pip install lightgbm`` command, you don't need to install the gcc compiler anymore.
Instead of that, you need to install the OpenMP library, which is required for running LightGBM on the system with the Apple Clang compiler.
You can install the OpenMP library by the following command: ``brew install libomp``.
  "You can install the OpenMP library by the following command: ``brew install libomp``.", UserWarning)

I've tried to install libomp using brew and do pip install lightgbm but still I can't run my app perfectly.

enter image description here

P.s: I'm new to mac environment

1 Answers

Please see:

https://github.com/microsoft/LightGBM/issues/1933 https://github.com/microsoft/LightGBM/issues/1898

and specifically:

https://github.com/microsoft/LightGBM/issues/1898#issuecomment-455024936

As mentioned in those threads by contributors, the warning does not necessarily mean that you do not have lightgbm installed but shows that they've changed compiler for building wheels recently.

e.g. the errors you are getting are most likely not caused by this. If you describe more in detail which errors you are getting and what is not working I will update my answer.

However, as the answer currently is formulated it leads to believe you are taken aback by the warning you are getting and that you see that as the error (I am most likely wrong, which is why more details would be welcome)

If you can not run your code and actually have an error related to lightgbm you can try the following:

pip install wheel

pip install libomp

brew link libomp

You might need to make sure the lib and include directories are discoverable if /usr/local is not searched:

-L/usr/local/opt/libomp/lib -I/usr/local/opt/libomp/include
Related