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

Windows CPU环境安装PyTorch遇CondaVerificationError问题求助

Windows CPU环境下Conda装PyTorch遇CondaVerificationError的解决办法

问题情况

Windows纯CPU环境里,用下面任意一条Conda命令装PyTorch时,出现大量CondaVerificationError报错:

conda install pytorch::pytorch
# 或者
conda install pytorch torchvision torchaudio cpuonly -c pytorch

典型错误信息:

CondaVerificationError: 位于C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0的pytorch包已损坏。包清单中指定的路径'Lib/site-packages/torchgen/static_runtime/gen_static_runtime_ops.py'无法找到。

CondaVerificationError: 位于C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0的pytorch包已损坏。包清单中指定的路径'Scripts/torchrun-script.py'无法找到。

解决步骤

1. 删除损坏的PyTorch包

直接找到报错里的损坏包文件夹,删除整个目录:

C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0

2. 清理Conda缓存

打开Anaconda Prompt(或CMD,确保Conda环境已激活),执行缓存清理命令:

conda clean --all

出现确认提示时输入y回车即可。

3. 重新安装PyTorch

再次运行官方推荐的CPU版本安装命令:

conda install pytorch torchvision torchaudio cpuonly -c pytorch

如果仍有问题,可尝试指定具体版本安装(比如2.2.0):

conda install pytorch=2.2.0 torchvision torchaudio cpuonly -c pytorch

4. 备选方案:切换pip安装

如果Conda安装始终报错,改用pip安装。先激活目标Conda环境,再执行:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.29 06:53:39