“conda install”命令中c标志的用途是什么

2024-04-25 05:44:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在学习使用conda设置python环境,我注意到在anaconda云网站上,他们建议使用sintax安装包

conda install -c package

但是在conda文档中,它们使用相同的命令而不使用c标志。

有谁能向我解释一下c标志的用途是什么,应该在什么时候使用?


Tags: install文档命令package环境网站标志anaconda
2条回答

运行conda install -h后从CLI复制:

-c CHANNEL, --channel CHANNEL

Additional channel to search for packages. These are URLs searched in the order they are given (including file:// for local directories). Then, the defaults or channels from .condarc are searched (unless --override-channels is given). You can use 'defaults' to get the default packages for conda, and 'system' to get the system packages, which also takes .condarc into account. You can also use any name and the .condarc channel_alias value will be prepended. The default channel_alias is http://conda.anaconda.org/.

频道是Navigator和conda查找包的位置。(source)具有相同名称的包可能存在于多个通道上。如果希望从默认通道以外的其他通道安装,则指定要使用哪个通道的一种方法是使用conda install -c channel_name package_name语法。 另请阅读this以获取使用通道的安装过程的描述。

-c代表--channel。 它用于指定搜索包的频道。

例如,假设您想下载pytorch。你可以在anaconda.org上搜索。你会看到火把是火把的。那么,你只需要做一个:

conda install pytorch -c pytorch

相关问题 更多 >