```pipdeptree --reverse --packages xgboost``` - 如何解决库不兼容问题
```pipdeptree --reverse --packages xgboost``` - how to resovle library incompatibility
目标
- 我的最终目标是在 conda 环境中 运行 这个 kaggle 本地项目。
- 我 运行 在 Ubuntu 20.04 LTS,conda 环境,python 3.8
上安装这个
输入
- 我被推荐给 运行 this 代码,因为我有库依赖性问题。
pipdeptree --reverse --packages xgboost
输出
Warning!!! Possibly conflicting dependencies found:
* wandb==0.10.4
- subprocess32 [required: >=3.5.3, installed: ?]
* spyder==4.1.5
- pyqt5 [required: <5.13, installed: ?]
- pyqtwebengine [required: <5.13, installed: ?]
* QDarkStyle==2.8.1
- helpdev [required: >=0.6.10, installed: ?]
* Flask-Compress==1.5.0
- brotli [required: Any, installed: ?]
* dask-xgboost==0.1.11
- xgboost [required: <=0.90, installed: 1.2.0]
* dash==1.16.3
- dash-core-components [required: ==1.12.1, installed: 1.3.1]
- dash-html-components [required: ==1.1.1, installed: 1.0.1]
- dash-renderer [required: ==1.8.2, installed: 1.1.2]
- dash-table [required: ==4.10.1, installed: 4.4.1]
------------------------------------------------------------------------
xgboost==1.2.0
- dask-xgboost==0.1.11 [requires: xgboost<=0.90]
更新
现在我已经重新安装了 XGBoost 并且
conda install -c conda-forge xgboost
当我 运行 在 jupyter 中导入我的代码时,它说
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-f5a95d2c9926> in <module>
3 from dask.distributed import Client
4 from dask import array as da
----> 5 import xgboost as xgb
6 from xgboost import dask as dxgb
7 from xgboost.dask import DaskDMatrix
ModuleNotFoundError: No module named 'xgboost'
如果你创建一个新的 conda 环境,你会得到同样的错误吗?例如
conda create -n kaggle_xgboost_test python=3.8 pandas numpy scikit-learn xgboost jupyter
conda activate kaggle_xgboost_test
# Then open a notebook
jupyter-notebook
# And try to import xgboost with e.g.
import xgboost
print("imported ok")
编辑
如果新环境 installed/imported xgboost 没有任何问题(如您的评论所暗示),那么您遇到的问题是您现有环境所特有的。您是否解决了 pipdeptree --reverse --packages xgboost
确定的冲突?你试过building xgboost from source with GPU support enabled了吗?例如
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON
make -j4
目标
- 我的最终目标是在 conda 环境中 运行 这个 kaggle 本地项目。
- 我 运行 在 Ubuntu 20.04 LTS,conda 环境,python 3.8 上安装这个
输入
- 我被推荐给 运行 this 代码,因为我有库依赖性问题。
pipdeptree --reverse --packages xgboost
输出
Warning!!! Possibly conflicting dependencies found:
* wandb==0.10.4
- subprocess32 [required: >=3.5.3, installed: ?]
* spyder==4.1.5
- pyqt5 [required: <5.13, installed: ?]
- pyqtwebengine [required: <5.13, installed: ?]
* QDarkStyle==2.8.1
- helpdev [required: >=0.6.10, installed: ?]
* Flask-Compress==1.5.0
- brotli [required: Any, installed: ?]
* dask-xgboost==0.1.11
- xgboost [required: <=0.90, installed: 1.2.0]
* dash==1.16.3
- dash-core-components [required: ==1.12.1, installed: 1.3.1]
- dash-html-components [required: ==1.1.1, installed: 1.0.1]
- dash-renderer [required: ==1.8.2, installed: 1.1.2]
- dash-table [required: ==4.10.1, installed: 4.4.1]
------------------------------------------------------------------------
xgboost==1.2.0
- dask-xgboost==0.1.11 [requires: xgboost<=0.90]
更新
现在我已经重新安装了 XGBoost 并且
conda install -c conda-forge xgboost
当我 运行 在 jupyter 中导入我的代码时,它说
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-f5a95d2c9926> in <module>
3 from dask.distributed import Client
4 from dask import array as da
----> 5 import xgboost as xgb
6 from xgboost import dask as dxgb
7 from xgboost.dask import DaskDMatrix
ModuleNotFoundError: No module named 'xgboost'
如果你创建一个新的 conda 环境,你会得到同样的错误吗?例如
conda create -n kaggle_xgboost_test python=3.8 pandas numpy scikit-learn xgboost jupyter
conda activate kaggle_xgboost_test
# Then open a notebook
jupyter-notebook
# And try to import xgboost with e.g.
import xgboost
print("imported ok")
编辑
如果新环境 installed/imported xgboost 没有任何问题(如您的评论所暗示),那么您遇到的问题是您现有环境所特有的。您是否解决了 pipdeptree --reverse --packages xgboost
确定的冲突?你试过building xgboost from source with GPU support enabled了吗?例如
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON
make -j4