Conda可以创建一个environment.yml
,它同时指定conda包和pip包。问题是,我想指定一个pip包(torch==1.12.1+cu116
),它只在以下索引中可用:https://download.pytorch.org/whl/cu116。
我如何在environment.yml中指定这一点?或者至少,在运行conda env create -f environment.yml
时,我想为pip指定额外的索引。
发布于 2022-08-09 07:50:10
此配置应该可以工作,请参阅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
另请参阅
https://stackoverflow.com/questions/73287475
复制相似问题