ubuntu 安裝xgboost


Ubuntu 安裝xgboost

1、 安裝gcc g++

Sudo apt-get install gcc g++

遇到問題:

E: Could not open lock file /var/lib/dpkg/lock - open (13 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

分兩種情況:
         先看到底有沒開兩個apt,如果確定沒開兩個APT-GET,請sudo rm /var/lib/dpkg/lock,這樣就刪除了鎖文件,然后運行sudo dpkg --configure -a重新配置。 問題解決。

 

2、 下載xgboost安裝

Cd xgboost*

Make –j4

#遇到問題:

errorError:setup script specifies an absolute path:

/home/llp/Desktop/xgboost-master/python-package/xgboost/../../wrapper/libxgboostwrapper.so

解決辦法

修改setup.py

include_package_data=False,  (原來是True

再次運行python3 setup.py install 即可

系統顯示是正常安裝了。

 

3、 驗證是否安裝成功

>>> import xgboost

繼續報錯

xgboost OSError../lib/libgomp.so.1:version GOMP_4.0not found(required by ../xgboost/../../wrapper/libxgboostwrapper.so)

 

 

4、 刪除安裝的xgboost

 Cd /home/llp/anaconda3/lib/python3.5/site-packages

Rm –rf xgboost*

 

 

5、 重新安裝xgboost,安裝一些依賴包

http://blog.csdn.net/tobeyourlover/article/details/53244421

顯示安裝成功!!

 

繼續報錯

xgboost OSError../lib/libgomp.so.1:version GOMP_4.0not found(required by ../xgboost/../../wrapper/libxgboostwrapper.so)

 

但是,在安裝成功的信息顯示表明,xgboost是安裝在系統默認的python2.7版本中,但是anaconda中使用的是3.5版本的python。原來安裝的是python2.7版本的xgboost

 

6、 刪除所有xgboost*的相關目錄,重新安裝:

Pip install xgboost  

依舊報錯:

https://github.com/dmlc/xgboost/issues/820

"/home/ashish/anaconda2/bin/../lib/libgomp.so.1: version `GOMP_4.0' not found (required by /home/ashish/anaconda2/lib/python2.7/site-packages/xgboost/./lib/libxgboost.so)"

解決方法:

https://github.com/dmlc/xgboost/issues/1786

tep 1 : use the following commands to check whether the libgomp.so.1 file in anconda contains the required version GOMP_4.0 (replace the path by your own in all the steps) :

string /home/yin/anaconda3/bin/../lib/libgomp.so.1 |grep GOMP ( if there is not GOMP_4.0 version ,go to step 2, else leave a comment )

step 2: to check libgomp.so.1 in your OS:

sudo find / -name libgomp.so.1*

step3: check the link in anaconda

ls -al /home/yin/anaconda3/bin/../lib/libgomp.so.1 if the link not link to the newest verison in step 2 's list , then make a new link to update it by:

sudo rm -rf /home/yin/anaconda3/bin/../lib/libgomp.so.1

sudo ln -s <path of the newest version libgomp file in your OS > <path in anaconda>

【在/usr/lib/x86*/目錄下找到一個更新的libgomp-1.0.so.0.1.0,將其拷貝到anaconda3lib目錄下。按照上面說的刪除舊的軟鏈接,建立新的軟鏈接,注意:libgomp.so.1libgomp.so都需要進行這樣的操作】

若繼續報錯,缺少其它類似這樣的文件,還是用此方法解決。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM