gpt4 book ai didi

pip - 如何在conda环境文件中指定 pip 查找链接选项?

转载 作者:行者123 更新时间:2023-12-03 15:55:14 27 4
gpt4 key购买 nike

我有一个pip要求文件,其中包括Torch和Torchvision的特定于CPU的特定版本。我可以使用以下pip命令成功安装我的需求。

pip install --requirement azure-pipelines-requirements.txt --find-links https://download.pytorch.org/whl/torch_stable.html

我的需求文件如下所示

coverage
dataclasses
joblib
matplotlib
mypy
numpy
pandas
param
pylint
pyro-ppl==1.2.1
pyyaml
scikit-learn
scipy
seaborn
torch==1.4.0+cpu
torchvision==0.5.0+cpu
visdom

这在bash上有效,但是如何在conda环境yaml文件中使用 find-links选项调用pip?我目前的尝试是这样的

name: build  
dependencies:
- python=3.6
- pip
- pip:
- --requirement azure-pipelines-requirements.txt --find-links https://download.pytorch.org/whl/torch_stable.html

但是当我调用

conda env create --file azure-pipeline-environment.yml

我得到这个错误。

Pip subprocess error:
ERROR: Could not find a version that satisfies the requirement torch==1.4.0+cpu (from -r E:\Users\tim\Source\Talia\azure-pipelines-requirements.txt (line 25)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.4.0+cpu (from -r E:\Users\tim\Source\Talia\azure-pipelines-requirements.txt (line 25))

CondaEnvException: Pip failed



从conda环境yaml文件调用pip时,如何指定 find-links选项?

最佳答案

This example显示了如何指定 pip 的选项

首先指定全局pip选项:

name: build  
dependencies:
- python=3.6
- pip
- pip:
- --find-links https://download.pytorch.org/whl/torch_stable.html
- --requirement azure-pipelines-requirements.txt

关于pip - 如何在conda环境文件中指定 pip 查找链接选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60410173/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com