为什么 pip install 不适用于 catboost?

Why does pip install not work for catboost?

我必须安装 catboost 但无法在 pip install catboost 之前完成。

Anaconda 中没有catboost 库,只能用pip 的方式。

错误信息是:

Could not find a version that satisfies the requirement catboost <for version: >
No matching distribution found for catboost.

Python 版本是 3.6.3.

错误截图:

error message

我试过了:

pip install catboost==0.12.2
pip install catboost==0.12.1.1
pip install catboost==0.12.1
pip install catboost==0.12.0

pip install catboost==0.11.0
pip install catboost==0.10.2

None 这些作品。

为什么会出现这个问题,有没有其他安装catboost的方法?

来自docs

仅64位版本Python支持安装。

您需要重新安装 64 位版本 python 才能使用 cat boost 包

我遇到了同样的问题,但主要与 Docker 有关,因为错误仅在我尝试通过 docker 安装它时发生 - 结果发现与M1 Apple架构,解决方案是修改docker命令如下

docker buildx build --platform=linux/amd64 -t ${IMAGE_TAG} -f Dockerfile

对我来说,问题是我在 M1 Mac 上开发。尝试以 root 身份安装,使用 conda 和使用 docker 映像均未成功。

我发现的修复是使用 arm64 docker 图像作为我的基础。 docker文件代码为:

FROM amd64/python:3.9-buster

RUN pip install -U pip
RUN pip install --upgrade setuptools
RUN pip install catboost

不记得我是如何得到上面的代码的,但是感谢https://github.com/prabodh1194 for putting this together. A dockerfile with this code can be found here (as of 25NOV2021) https://github.com/prabodh1194/docker_images/blob/main/catboost/0.26/Dockerfile

在我的例子中,虚拟环境使用的是旧版本的 pip,并且对 pip 进行了简单的升级!

python3 -m pip install --upgrade pip