![](/img/trans.png)
[英]How do I completely purge and disable the default channel in Anaconda and switch to conda-forge?
[英]How do I control default channels with conda constructor when building from conda-forge?
我有一個 conda 構造函數過程,它只使用 conda-forge 包(加上我自己的)創建安裝程序,但是當我測試它並使用 conda info 時,默認頻道都是 anaconda 頻道,甚至不包括 conda-forge。 這意味着除非添加 -c conda-forge,否則通常的 conda 命令(如 install 和 create)通常會失敗。
請注意,我的 construct.yaml 確實有線條
channels:
- https://conda.anaconda.org/conda-forge
conda_default_channels:
- https://conda.anaconda.org/conda-forge
我認為后者應該設置默認頻道,但是當安裝程序運行時,這似乎沒有被帶入 conda 安裝。 FWIW,我在構建或安裝機器上都沒有 ~/.condarc,構造函數位置的 the.condarc 僅包含:
channels:
- conda-forge
我知道我可以在 package 目錄中創建一個包含以下內容的 .condarc 文件:
channels:
- conda-forge
- defaults
channel_priority: true
(或者甚至省略 defaults 行,因為我真的不需要來自 anaconda 頻道的任何東西),但這看起來真的很笨拙。 我認為應該有更好的方法。
據我所知,anaconda 回購被硬編碼到 conda 中,但使用了 construct.yaml 設置
write_condarc: True
導致安裝時將 a.condarc 文件寫入項目目錄,這會覆蓋通道。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.