CentOS7.9 安装 xgboost 报错及处理

CentOS7.9 安装 xgboost 报错及处理



【报错】:Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ktq1dypw/xgboost/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-1wala8fx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ktq1dypw/xgboost/
【原因】:安装工具包时需要抓取网页因而要处理 https,而处理 https 又依赖加解密算法(即 cryptography 包),而 cryptography 又依赖傅立叶变换的算法以及相应的编译环境。Ubuntu 16.04 默认没有安装 libffi-dev 和 libssl-dev,gcc 也不一定安装,而 目标安装包又没有将相关软件包记到依赖列表里,
【解决方法】:sudo pip3 install python3-setuptools

在使用上述方法后问题未解决


【报错】显示setuptools已经安装
【原因】所需要的依赖包所在的setuptools dust需要的是pip 2.x版本的
【解决方法】

  1. 首先需要安装pip old version 并下载pip2 的setuptoolspip3 install -U pip setuptools
  2. 使用pip安装对应的依赖包 pip install cryptography --force-reinstall and pip install paramiko --force-reinstall
  3. 依赖包安装成功,可以使用pip 安装xgboost了,但会出现一个warning

【警告】WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
【原因】pip正在被一个旧的脚本包装器调用。 这将在pip的未来版本中失败
该问题出现于我在系统下使用如下命令安装了一个新版本的pip后,使用原先的pip3进行一些操作出现的提问。
【解决方法】python3 -m pip install --upgrade pip使用如下命令卸载这个新的pip即可pip3 uninstall pip

posted @ 2022-04-22 10:30  silas12138  阅读(269)  评论(0)    收藏  举报