Search code examples
pythonpipapple-m1kagglelightgbm

Is LightGBM available for Mac M1?


My goal is to learn a notebook. It has recall 97% while I am struggling with F1 Score 'Attrited Customer' 77.9%. The problem is the notebook uses LightGBM. I am unable to install LightGBM.

What I've tried:

  1. pip install lightgbm -> it throws error python setup.py egg_info did not run successfully.
  2. Then, I did pip install wheel -> now it throws error python setup.py bdist_wheel did not run successfully.
  3. Then, I did pip install Cmake, pip install --upgrade pip setuptools, brew install libomp -> the error persisted.

The full error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [80 lines of output]
      INFO:root:running bdist_wheel
      /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      INFO:root:running build
      INFO:root:running build_py
      INFO:root:creating build
      INFO:root:creating build/lib
      INFO:root:creating build/lib/lightgbm

Solution

  • As of this writing, no official release of lightgbm (the Python package for LightGBM) supports the M1 Macs (which us ARM chips).

    osx-arm64 builds of lightgbm are supported by the lightgbm conda-forge feedstock, so you can install lightgbm on an M1 Mac using conda.

    conda install \
       --yes \
       -c conda-forge \
       'lightgbm>=3.3.3'
    

    Progress towards officially supporting M1 Mac builds of LightGBM can be tracked in microsoft/LightGBM#5269 and microsoft/LightGBM#5328.