ubuntu16.04(liunx) 离线安装 xgboost (anaconda3,anaconda2共存)

服务器ubuntu 系统同时安装了 anaconda3,anaconda2 ,但服务器没有连接外网,所以 想在python3 环境下安装离线安装xgboost。

主要分2步:

  0:进入py3环境  (source activate py3) (具体anaconda3,anaconda2 共存见 http://www.cnblogs.com/zle1992/p/6720425.html)  

  1.编译xgboost  

  2.安装xgboost python 包

1 编译xgboost

1.1 在联网的电脑上下载 xgboost 编译所需文件。

git clone --recursive https://github.com/dmlc/xgboost

下载好后,把文件复制到Ubuntu系统上。放到/home目录下!

1.2进入xgboost目录,编译。

cd xgboost; make -j4

ps:由于时钟同步问题,可能出现 warning: Clock skew detected. Your build may be incomplete.这样的警告,

解决办法:

find . -type f | xargs -n 5 touch
make clean
make

 

 

2.安装xgboost python 包

有好几种方式,官方推荐下面这种:

2.1 打开~/.bashrc

vim ~/.bashrc

2.2 添加路径 

export PYTHONPATH=~/xgboost/python-package

完成!!!!

参考:

https://xgboost.readthedocs.io/en/latest/build.html#building-on-ubuntu-debian

posted @ 2017-05-16 13:50  乐乐章  阅读(2531)  评论(0编辑  收藏  举报