Python 尝试在Jupyter笔记本上运行XGBoost时出错

Python 尝试在Jupyter笔记本上运行XGBoost时出错,python,jupyter-notebook,xgboost,Python,Jupyter Notebook,Xgboost,我通过pip安装了xgboost,并试图在Jupyter笔记本上运行它。 但是,在运行时 from xgboost import XGBClassifier 在Python 3 jupyter笔记本上,我发现以下错误: OSError: /home/martin/anaconda3/bin/../lib/libgomp.so.1: version GOMP_4.0' not found (required by /home/martin/anaconda3/lib/python3.6/site

我通过pip安装了xgboost,并试图在Jupyter笔记本上运行它。 但是,在运行时

from xgboost import XGBClassifier
在Python 3 jupyter笔记本上,我发现以下错误:

OSError: /home/martin/anaconda3/bin/../lib/libgomp.so.1: version GOMP_4.0' not found (required by /home/martin/anaconda3/lib/python3.6/site-packages/xgboost/./lib/libxgboost.so)

我该怎么办?

解决了。再次,在

要使GOMP_4.0正常工作,请执行以下步骤:

1) 在终端上输入以下内容(用自己的路径替换路径)

你会得到一个列表,GOMP_4.0很可能不在那里(如果是的话,我认为这不会起作用,因为这不是问题)

2) 进入

您将得到一个地址列表。对每个字符串重复步骤1(
strings | grep GOMP
),直到找到一个包含GOMP_40的字符串(在我的例子中是
/usr/lib/x86_64-linux-gnu/libgomp.so.1

3) 现在输入以下内容,首先输入原始路径,然后输入包含GOMP_4.0的路径

sudo rm -rf <path in anaconda>
sudo ln -s <path with GOMP_4.0> <path in anaconda>
这应该可以解决问题。但是,在这之后,我遇到了一个类似的错误:

OSError:/home/martin/anaconda3/lib/python3.6/site-packages/zmq/backe‌​nd/cython/../../../。‌​./.././libstdc++.so。‌​6:找不到版本“GLIBCXX_3.4.20”(由/home/martin/anaconda3/lib/python3.6/site packages/xgboost/要求)。‌​/lib/libxgboost.so)


我用同样的方法解决了这个问题,除了这次,在步骤1中使用
| grep GLIBCXX
在步骤2中使用sudo find/-name libgomp.so.1*
),这次使用GLIBCXX_3.4.20。

更新:我从问题中得到了一些帮助,现在我得到了以下错误:OSError:/home/martin/anaconda3/lib/python3.6/site packages/zmq/backend/cython/../../../../../../../../../../../../../../../../../../libstdc++.so.6:找不到版本“GLIBCXX\u 3.4.20”(由/home/martin/anaconda3/libxgboost.so所需)
sudo find / -name libgomp.so.1*
sudo rm -rf <path in anaconda>
sudo ln -s <path with GOMP_4.0> <path in anaconda>
sudo rm -rf /home/martin/anaconda3/bin/../lib/libgomp.so.1
sudo ln -s /usr/lib/x86_64-linux-gnu/libgomp.so.1 /home/martin/anaconda3/bin/../lib/libgomp.so.1