在mac上安装Xgboost Python库
来源:互联网 发布:客户跟踪记录软件 编辑:程序博客网 时间:2024/06/06 15:51
最近在mac上用到xgboost库,安装时遇到颇多大坑,网上查了很多答案几乎都是win上的问题,没遇到理想的,自己也就摸着石头把几个大坑给填了,总结一下,给后人少走点弯路。
1.错误
倘若直接 pip install xgboost
时,会出现Command "python setup.py egg_info" failed with error code 1
的错误提示,
还是乖乖使用Github源代码安装吧~
2.正确的打开方式
- 1.
终端输出:cd ~git clone --recursive https://github.com/dmlc/xgboost
Cloning into 'xgboost'...remote: Counting objects: 19864, done.remote: Total 19864 (delta 0), reused 0 (delta 0), pack-reused 19863Receiving objects: 100% (19864/19864), 6.69 MiB | 76.00 KiB/s, done.Resolving deltas: 100% (11937/11937), done.Submodule 'dmlc-core' (https://github.com/dmlc/dmlc-core) registered for path 'dmlc-core'Submodule 'rabit' (https://github.com/dmlc/rabit) registered for path 'rabit'Cloning into '/Users/henrylee/xgboost/dmlc-core'...Cloning into '/Users/henrylee/xgboost/rabit'...Submodule path 'dmlc-core': checked out 'b5bec5481df86e8e6728d8bd80a61d87ef3b2cd5'Submodule path 'rabit': checked out 'a764d45cfb438cc9f15cf47ce586c02ff2c65d0f'
可看出gitclone下来的时候回自动clone上其引用库,而直接使用Release包则不会
- 2.
注意: 倘若直接使用cd xgboost
会出现:cd python-package; sudo python setup.py install
的错误提示,意思是你还是先跑跑文件夹下面的build.sh吧Traceback (most recent call last):File "setup.py", line 19, in <module>LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()]File "xgboost/libpath.py", line 46, in find_lib_path'List of candidates:\n' + ('\n'.join(dll_path)))__builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?
注:
使用Release包会报错/dmlc-core下找不到某文件,这也是不要使用Release包的原因 3.
那我就跑吧cd ~/xgboostbash build.sh
这时会出现一大堆C++编译,若无出现则可能像官网所说使用brew安装下GCC——
brew install gcc --without-multilib
4.
这个时候就真可以名正而顺地使用cd python-package; sudo python setup.py install
最后会终端出现:
Finished processing dependencies for xgboost==0.6
代表安装成功了。
如果帮到你了,请赞赏支持:
阅读全文
2 0
- 在mac上安装Xgboost Python库
- 在mac上安装Xgboost Python库
- 在mac上安装Xgboost Python库
- Mac 安装 XGBoost Python库
- 解决 Mac 上安装 Xgboost Python库报错
- mac上安装xgboost
- Mac上安装xgboost
- python+xgboost在windows上的安装和使用
- 如何在windows系统Python上安装xgboost ?
- xgboost在Python的安装
- mac上安装xgboost报错
- Mac系统安装python版Xgboost
- Mac下python xgboost的安装
- 在Mac os下安装xgboost
- Python库管理工具pip在Mac上安装卸载
- xgboost 在 windows 上的安装
- 在Mac 上安装opencv和python
- 在mac上安装python,pip,Ipython
- 时间选择器
- Xcode9 新功能
- Android相机实时自动对焦的完美实现
- css样式之页面上拉指定div置顶
- React-Native调用支付宝,微信
- 在mac上安装Xgboost Python库
- Html5调用手机相机并压缩、上传
- 只有挣扎的现在,才是最好的状态(转)(文/王文华)
- 基于tensorflow的视觉问答系统构建
- 如何解决Oracle ASM故障导致的数据丢失问题
- java ajax等传值中文乱码
- Sum All Primes
- 使用vue+elementUI编写运营活动生成工具
- 关于HttpURLConnection的用法