在我 运行 命令 "conda env create -f environment.yml" 之后发出警告

Warning after I run the command "conda env create -f environment.yml"

在 Conda 中 运行 conda env create -f environment.yml 之后,我收到以下警告:

Warning : you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies...

这是什么意思,我应该怎么做?

在您通过 conda 安装的包列表下的环境 yml 文件中,您还必须添加 pip 作为要安装的包。这会安装 pip,因此可以使用此 pip 安装 pip 包。

以前 pip 与 conda 一起提供,但现在我们必须在使用 conda 时显式安装 pip

创建环境时,通过在 yaml 文件中明确包含 - pip,警告消失了。是的,这有点尴尬,因为如果你的环境有 pip 包,你已经声明你使用 pip 包 - pip:
yaml 文件如下所示:

# Packages omitted for simplicity
name: myenv
channels:
  - anaconda
  - conda-forge
  - defaults
dependencies:
  - python
  - scipy
  - pip
  - pip:
    - datetime

在从头开始创建新环境时,可以通过显式安装 pip 来避免变暖,例如:conda create -n env_with_pip python=3.7 numpy pip