[英]How to specify pip --extra-index-url in environment.yml?
Conda can create an environment.yml
that specifies both conda packages & pip packages. Conda 可以创建一个
environment.yml
来指定 conda 包和 pip 包。 The problem is, I want to specify a pip package ( torch==1.12.1+cu116
), that is only available in the following index: https://download.pytorch.org/whl/cu116 . The problem is, I want to specify a pip package (
torch==1.12.1+cu116
), that is only available in the following index: https://download.pytorch.org/whl/cu116 .
How can I specify this in the environment.yml?如何在 environment.yml 中指定它? Or at the very least, when running
conda env create -f environment.yml
, I would like to specify the extra index for pip.或者至少,在运行
conda env create -f environment.yml
时,我想为 pip 指定额外的索引。
This configuration should work, see the advanced-pip-example
for other options.此配置应该可以工作,其他选项请参见
advanced-pip-example
。
name: foo
channels:
- defaults
dependencies:
- python
- pip
- pip:
- --extra-index-url https://download.pytorch.org/whl/cu116
- torch==1.12.1+cu116
See also也可以看看
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.