在安装causal-conv1d和 mamba-ssm时,Kaggle的 wheel构建失败

人工智能 2026-07-10

我正在Kaggle上安装mamba-ssm。当前使用的是H100 GPU。以下是当前配置

pytorch-ignite                           0.5.3
pytorch-lightning                        2.6.1
torch                                    2.10.0+cu128
torchao                                  0.10.0
torchaudio                               2.10.0+cu128
torchcodec                               0.10.0+cu128
torchdata                                0.11.0
torchinfo                                1.8.0
torchmetrics                             1.9.0
torchsummary                             1.5.1
torchtune                                0.6.1
torchvision                              0.25.0+cu128

我正在尝试使用Kaggle数据集中的预装wheel来安装它。同时也尝试从GitHub安装。

error: subprocess-exited-with-error

  × Building wheel for causal-conv1d (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for causal-conv1d
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (causal-conv1d)
Building wheels for collected packages: mamba-ssm
  error: subprocess-exited-with-error

  × Building wheel for mamba-ssm (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for mamba-ssm (pyproject.toml) ... error
  ERROR: Failed building wheel for mamba-ssm
Failed to build mamba-ssm
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mamba-ssm)

请指引我接下来该怎么做。

解决方案

The installation guide says:

--no-build-isolation 是必须的,这样pip才能使用你现有的已启用CUDA的 PyTorch,而不是在隔离的构建环境中安装torch-cpu。

并且在 PyPI 上也有重复说明:

Try passing --no-build-isolation to pip if installation encounters difficulties either when building from source or installing from PyPi. Common pip complaints that can be resolved in this way include PyTorch versions, but other cases exist as well.

要安装causal Conv1d,请运行:

pip install causal-conv1d>=1.4.0 --no-build-isolation

或者获取核心Mamba包:

pip install mamba-ssm --no-build-isolation:

要同时安装两者:

pip install mamba-ssm[causal-conv1d] --no-build-isolation

参见 https://github.com/state-spaces/mamba

站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。

相关文章