You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决Python包安装时的ERROR: Failed building wheel for cuvec错误

Python包安装错误求助(cuvec编译失败)

环境信息

  • Python版本:3.9
  • Ubuntu版本:20.04

错误详情

note: 此错误源自子进程,大概率与pip无关。

ERROR: Failed building wheel for cuvec
Failed to build cuvec
ERROR: Could not build wheels for cuvec, which is required to install pyproject.toml-based projects
error: subprocess-exited-with-error

× 用于安装构建依赖的pip子进程未成功运行。
│ 退出码: 1
╰─> 查看上方输出获取详情。

note: 此错误源自子进程,大概率与pip无关。

完整执行命令:

//home/pc6/yes/bin/python /home/pc6/.local/lib/python3.9/site-packages/pip/__pip-runner__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-4ou8yuqy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=42' wheel 'setuptools_scm[toml]>=3.4' 'cuvec>=2.5.0' 'ninst>=0.10.0' 'numpy>=1.14' 'miutil[cuda]>=0.4.0' 'scikit-build>=0.11.0' 'cmake>=3.18' ninja

工作目录:[继承]
安装构建依赖... 错误
error: subprocess-exited-with-error

× 用于安装构建依赖的pip子进程未成功运行。
│ 退出码: 1
╰─> 查看上方输出获取详情。

note: 此错误源自子进程,大概率与pip无关。

解决步骤

1. 安装系统基础编译工具

cuvec需要本地编译,先补上Ubuntu的基础构建依赖:

sudo apt update && sudo apt install build-essential gcc g++ git

2. 检查/安装CUDA环境(若需GPU支持)

依赖中包含miutil[cuda],说明需要CUDA环境:

  • 先检查CUDA是否已安装:nvcc --version
  • 未安装的话,可通过Ubuntu仓库快速安装:
sudo apt install nvidia-cuda-toolkit

注:若需要特定版本CUDA,可前往NVIDIA官网下载适配Ubuntu20.04的11.x版本安装包

3. 升级pip及构建工具

确保pip、setuptools、wheel处于最新版本,避免工具兼容性问题:

pip install --upgrade pip setuptools wheel

4. 手动预安装构建依赖

先单独安装所有指定的构建依赖,再尝试安装目标包:

pip install 'setuptools>=42' wheel 'setuptools_scm[toml]>=3.4' 'cuvec>=2.5.0' 'ninst>=0.10.0' 'numpy>=1.14' 'miutil[cuda]>=0.4.0' 'scikit-build>=0.11.0' 'cmake>=3.18' ninja

如果cuvec编译仍失败,且不需要GPU支持,可尝试安装不带CUDA的版本:

pip install cuvec --no-deps miutil

5. 尝试用conda安装(备选方案)

pip编译问题难以解决时,conda能自动处理大部分编译依赖:

conda create -n py39_env python=3.9
conda activate py39_env
conda install -c conda-forge cuvec numpy scikit-build cmake ninja

内容的提问来源于stack exchange,提问作者tahereh zare

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 10:21:58