2016-05-01 163 views
2

我運行的Python 2.7使用在Mac蟒蛇分佈,當我試圖通過PIP安裝xgboost,我看到以下錯誤:麻煩xgboost安裝(Mac OS)中

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/zk/zh9sqr0n2n91v0smc5ypcz7w0000gn/T/pip-build-eh4_ag8h/xgboost/

我試着更新pip和setuptools,這兩者似乎都是最新的。雞蛋錯誤依然存在!

有任何mac/python 2用戶運行此問題?

回答

0

這個問題有很好的討論here。我發現Joe Nyland的答案對我來說非常合適(運行brew安裝gcc @ 5可能需要很長時間,所以請爲此做好準備)。

下面是他的回答:

Success!

I found this here:

clang LLVM compiler on Mac OS X from Xcode doesn't support OpenMP multi-thread. An alternative choice is installing homebrew http://brew.sh/ and brew install g++-5 which provides multi-thread OpenMP support. Bearing that in mind, I tried this and it allows me to install from pip!

$ brew install [email protected]

$ pip install xgboost

I have no idea why this works but brew install gcc --without-multilib didn't.

I can't help but think other users will fall into this trap and waste time trying to work out what is actually going wrong. Hopefully this workaround works for them but I'd prefer to see a more reliable installation routine from the pip package