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

使用conda --file参数安装cudnn=6.0.0遇PackageNotFoundError求助

Why does conda install --file fail to find cudnn=6.0.0 but the direct command works?

Let's break down why you're seeing this discrepancy and how to fix it:

The Root Cause

When you use conda install --file, Conda parses the package list in a stricter, more literal way compared to specifying packages directly on the command line.

In your case, cudnn=6.0.0 is only hosted in the anaconda channel. When you run the direct command:

conda install -y cudnn=6.0.0 -p <env_path>

Conda automatically searches through all configured channels (including the anaconda channel) to locate the matching package version.

However, when using --file b.txt, Conda doesn't automatically associate the package with its required channel unless explicitly told to do so. Your b.txt only lists cudnn=6.0.0, so Conda only checks the channels shown in your error message (defaults + conda-forge) where this specific version isn't available.

Fixes to Try

1. Add the channel prefix to your package file

Modify b.txt to explicitly tie the package to the anaconda channel:

anaconda::cudnn=6.0.0

Then re-run your original command:

conda install -y --file b.txt -p <env_path>

2. Explicitly include the channel in the install command

If you don't want to edit the package file, add the -c anaconda flag to force Conda to search that channel when processing the file:

conda install -y --file b.txt -c anaconda -p <env_path>

Either approach should let Conda locate and install cudnn=6.0.0 successfully via the package file.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.15 03:57:29