If you don't mind doing a conda install, try:
import sys
!conda install --yes --prefix {sys.prefix} -c conda-forge lightgbm
!conda install --yes --prefix {sys.prefix} -c conda-forge lightgbm
This resolved the problem for me (run in a jupyter notebook cell)
brew install openssl
brew install openssl gcc@4.9
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc --without-glibc
brew search gcc
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc --without-glibc
brew search gcc
gcc-4.4 --version
gcc-4.4 (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[ling@dev6-ling-4105472d.bf2 A:DEVEL ~]$ brew install openssl
==> Downloading https://www.openssl.org/source/openssl-1.0.2p.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/home/ling/.linuxbrew/Cellar/openssl/1.0.2p --openssldir=/home/ling/.linuxbrew/etc/openssl no-ssl2 no-ssl3 no-zlib shared enable-cms -Wa,--noexecstack
==> make depend
==> make
==> make test
==> make install MANDIR=/home/ling/.linuxbrew/Cellar/openssl/1.0.2p/share/man MANSUFFIX=ssl
==> Downloading https://curl.haxx.se/ca/cacert-2017-01-18.pem
######################################################################## 100.0%
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/home/ling/.linuxbrew/etc/openssl/certs
and run
/home/ling/.linuxbrew/opt/openssl/bin/c_rehash
==> Summary
🍺 /home/ling/.linuxbrew/Cellar/openssl/1.0.2p: 1,792 files, 14.1MB, built in 5 minutes 33 seconds
[ling@dev6-ling-4105472d.bf2 A:DEVEL ~]$ ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
https://github.com/Linuxbrew/brew/wiki/Symlink-GCC
The system is: Linux - 2.6.32-573.8.1.el6.x86_64 - x86_64
sudo pip install glibc
brew install cmake git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM export CXX=g++-7 CC=gcc-7 mkdir build ; cd build cmake .. make -j4 pip install lightGBM
cd LightGBM/python-package
export CXX=g++-7 CC=gcc-7
python setup.py install
conda install cmake
conda install glibc
/home/ling/.linuxbrew/bin/gcc-4.4
ftp http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
https://github.com/Microsoft/LightGBM/issues/701
https://github.com/Microsoft/LightGBM/issues/701
yum install firefox
yum -y install firefox
yum remove firefox
yum -y install firefox
yum update mysql
yum list openssh
yum search vsftpd
yum info firefox
yum list | less
yum list installed | less
yum provides /etc/http/donf/httpd.conf
yum check-update
yum update
yum grouplist
yum group install 'MYSQL Database'
yum group update 'DNS Name Server'
yum group remove 'DNS Name Server'
yum repolist
yum repolist all
yum list openssh
yum search vsftpd
yum info firefox
yum list | less
yum list installed | less
yum provides /etc/http/donf/httpd.conf
yum check-update
yum update
yum grouplist
yum group install 'MYSQL Database'
yum group update 'DNS Name Server'
yum group remove 'DNS Name Server'
yum repolist
yum repolist all
yum clean all