Conda environment.yaml で channel_priority を設定する 質問する

Conda environment.yaml で channel_priority を設定する 質問する

channel_priorityyaml ファイルを使用して環境を作成するときにを設定することは可能ですかstrict? 例:

name: my_environment
channels:
  - conda-forge
dependencies:
  - python
  - geopandas
  - rasterio

ベストアンサー1

もう一つの注意点は、特定のパッケージの指定されたチャネルをセクションにリストする必要がないことですchannels。予期しないチャネルから他のパッケージを (再) インストールするリスクがないため、この方が安全だと思います。

たとえば、次のようになります。

channels:
  - defaults

dependencies:
  - python =3.8
  - ...
  # specifically from conda-forge (but only those):
  - conda-forge::nbsphinx

の代わりに:

# NO!
channels:
  - defaults
  - conda-forge

dependencies:
  - python =3.8
  - ...
  - conda-forge::nbsphinx

重要なのは、これがインストールされるようだのみ指定されたパッケージを からインストールし、それらの依存関係グラフ内にあるが、 から既に入手可能なパッケージのバージョン(おそらく少し最新ではないバージョン)をconda-forge(再)インストールしようとはしません。conda-forgepkgs/main

おすすめ記事