XGBoost error

Aditya_c1
Aditya_c1 Registered Posts: 5

Our solution:

  • Dear Abhinav,

The issue you're encountering seems to stem from the missing `libomp` library, which is required by XGBoost on macOS. Let's walk through a possible resolution:

Steps to resolve the missing `libomp` issue:

1. Install OpenMP (libomp):   On macOS, you need to install `libomp`, which provides the OpenMP runtime. Run the following command using Homebrew to install it:   ``` brew install libomp   ```

2. Verify installation:   After installation, verify if `libomp` is correctly installed by checking the installed files:   ``` ls /usr/local/opt/libomp/lib   ```   This should list the `libomp.dylib` files required by XGBoost

.3. Reinstall XGBoost in the virtual environment:   Make sure you're working in the virtual environment you set up. You can then uninstall and reinstall XGBoost:   ``` pip3 uninstall xgboost

pip3 install xgboost   ```

4. Ensure compatibility:   Since you might be using Python 3.13 in the virtual environment, verify that XGBoost is compatible with this Python version. If any issues persist, consider using a more stable Python version like 3.10 or 3.11 by creating a virtual environment specifically for those versions.

Additional Step (if using Dataiku):   If this error occurs within Dataiku, you may also need to ensure that the environment Dataiku is using recognizes the newly installed libraries. Restarting Dataiku after making the changes may help resolve lingering environment issues.

If these steps do not resolve the issue, please share your system configurations with us (macOS version, Python version, and any specific environment details). This will allow us to verify with the Dataiku community that the problem is not related to system compatibility. Because a lot of our learners have faced issues with XGBoost but the above steps were able to resolve the issue for them.

Best regards,Learning Support Team

  • 2 days ago

  • Abhinav Solanki

Thanks for sharing. I believe we are going around in circles. I have already tried the steps you shared. I tried them again - attached are the snapshots. Attached is my macOS config. I am using Python 3.13 

Abhinav_mac_specs.png Abhinav_ss2.png Abhinav_ss1.png

Can someone please help Abhinav with the above?

Answers

  • julesvanrie
    julesvanrie Registered Posts: 1

    I know this thread is old, but I stumbled upon it while trying to fix the same problem: training with DSS on my Apple Silicon (M1) MacBook.

    Root cause seems to be that DSS runs with Rosetta (i.e. as if you'd be running x86 architecture and not ARM). So, if you install libomp the regular way with brew it will install in another location, and it will be a version that DSS can't work with (ARM vs x86).

    Disclaimer: this might mess up your normal brew installation somewhat. Didn't try yet. Normally uninstalling the x86 brew and potentially removing some folders manually should solve that.

    What did the trick for me:

    1. Open the Applications folder and find Terminal (in the Utilities) folder. Right-click, get info, enable Rosetta.
    2. Open the terminal.
    3. Install brew: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    4. Install libomp: arch -x86_64 /usr/local/homebrew/bin/brew reinstall libomp.
    5. This installed libomp inside the Homebrew folder, but DSS searches for it in another place, so make a symbolic link: ln -s /usr/local/Homebrew/opt/libomp /usr/local/opt/libomp 
    6. Restart DSS completely, and try again.

    I don't think we really need to prepend with arch -x86-64, but I didn't want to retry without.

Setup Info
    Tags
      Help me…