Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ```pipdeptree——反向——包xgboost```——如何解决库不兼容问题_Python_Anaconda_Conda_Xgboost_Kaggle - Fatal编程技术网

Python ```pipdeptree——反向——包xgboost```——如何解决库不兼容问题

Python ```pipdeptree——反向——包xgboost```——如何解决库不兼容问题,python,anaconda,conda,xgboost,kaggle,Python,Anaconda,Conda,Xgboost,Kaggle,目标 我的最终目标是在conda环境中本地运行此项目 我在Ubuntu20.04LTS,conda环境,Python3.8上运行这个 输入 Warning!!! Possibly conflicting dependencies found: * wandb==0.10.4 - subprocess32 [required: >=3.5.3, installed: ?] * spyder==4.1.5 - pyqt5 [required: <5.13, installed:

目标

  • 我的最终目标是在conda环境中本地运行此项目
  • 我在Ubuntu20.04LTS,conda环境,Python3.8上运行这个
输入

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]
  • 有人建议我运行代码,因为我有库依赖性问题
输出

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]
当我在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'
---------------------------------------------------------------------------
ModuleNotFoundError回溯(上次最近调用)
在里面
3来自dask.distributed import Client
4从dask导入数组作为da
---->5将xgb作为xgb导入
6从xgboost导入dask作为dxgb
7从xgboost.dask导入DaskDMatrix
ModuleNotFoundError:没有名为“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")
编辑 如果fresh环境安装/导入的xgboost没有任何问题(如您的评论所示),那么您遇到的问题是现有环境所特有的。您是否解决了由
pipdeptree--reverse--packages xgboost
确定的冲突?你试过了吗?例如


在其他环境中,这不是问题,但问题是,如果我调用
conda list
,我已经在这里重新安装了xgboost,xgboost是ehre,py xgboost也是,但导入说它不在那里。(我已检查是否使用正确的笔记本url查看正确的环境)。目标将与kaggle项目中的目标一样,获得支持在GPU(Nvidia)上运行的xgboost
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")
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON
make -j4