当前位置:   article > 正文

MAC-OS使用xgboost时报错_/home/nvidia/anaconda3/lib/python3.8/site-packages

/home/nvidia/anaconda3/lib/python3.8/site-packages/xgboost/lib/../../xgboost

import xgboost时出现如下错误 

  1. XGBoostError: XGBoost Library (libxgboost.dylib) could not be loaded.
  2. Likely causes:
  3. * OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libomp.dylib for Mac OSX, libgomp.so for Linux and other UNIX-like OSes). Mac OSX users: Run `brew install libomp` to install OpenMP runtime.
  4. * You are running 32-bit Python on a 64-bit OS
  5. Error message(s): ['dlopen(/Users/opt/miniconda3/lib/python3.8/site-packages/xgboost/lib/libxgboost.dylib, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib\n Referenced from: /Users/opt/miniconda3/lib/python3.8/site-packages/xgboost/lib/libxgboost.dylib\n Reason: image not found']

根据提示安装 libomp后,无效

再次尝试使用conda 安装py-xgboost == 》解决上述问题,安装成功后 再次导入xgboost是出现新问题,如下

ImportError: cannot import name 'CUDF_concat' from 'xgboost.compat' (/Users/opt/miniconda3/lib/python3.8/site-packages/xgboost/compat.py)

使用 brew install xgboost 尝试解决,出现如下错误

  1. ==> Installing dependencies for xgboost: scipy
  2. ==> Installing xgboost dependency: scipy
  3. ==> Pouring scipy-1.7.0.arm64_big_sur.bottle.tar.gz
  4. tar: Error opening archive: Failed to open '/Users/Library/Caches/Homebrew/downloads/53c8571262d51367a124d616afb840f22508ed5c55ea82a4c75056ce819f390e--scipy-1.7.0.arm64_big_sur.bottle.tar.gz'
  5. Error: Failure while executing; `tar --extract --no-same-owner --file /Users/Library/Caches/Homebrew/downloads/53c8571262d51367a124d616afb840f22508ed5c55ea82a4c75056ce819f390e--scipy-1.7.0.arm64_big_sur.bottle.tar.gz --directory /private/tmp/d20210813-12057-75d0ez` exited with 1. Here's the output:
  6. tar: Error opening archive: Failed to open '/Users/Library/Caches/Homebrew/downloads/53c8571262d51367a124d616afb840f22508ed5c55ea82a4c75056ce819f390e--scipy-1.7.0.arm64_big_sur.bottle.tar.gz'

解决办法:根据提示缺什么依赖就手动安装什么依赖 ,如上图的提示,解决办法如下

brew install scipy

折腾一番后最终解决

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/313043
推荐阅读
相关标签
  

闽ICP备14008679号