Install the Lightgbm library on the mac of the m1 chip (valid for pro-testing)

Problem Description:

Referenced from: /opt/homebrew/anaconda3/envs/biligame/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so
Reason: tried: '/usr/local/opt/libomp/lib/libomp.dylib' (no such file), '/usr/local/lib/libomp.dylib' (no such file), '/usr/lib/libomp.dylib' (no such file)

There are a lot of comments on the Internet brew install libompor downloading some packages, but none of them solve the problem

! ! ! Note: If brew has already been installed, reinstall carefully, because the original configuration file ~/.zshrc will be overwritten, and you must remember to save your own configuration file

Solution

1. First, you need to configure the environment of Rosetta 2 (otherwise you cannot install the default Intel chip library)

Execute the command under the mac terminal:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

2. Then install homebrew based on the domestic source and execute the command:

arch -x86_64 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

After entering the above commands, follow the prompts. It is recommended to choose the University of Science and Technology of China or Tsinghua University

3. Then install libomp under the x86 architecture

arch -x86_64 brew install libomp

4. Then re-install lightgbm with pip

pip install lightgbm

Guess you like

Origin blog.csdn.net/weixin_45277161/article/details/131236627