使用conda从特定渠道安装软件包。

9

我需要在anaconda中安装版本为5.12的qt包,但是当前安装的版本是5.9.7。

>>> conda list qt -f
# packages in environment at /PATH/anaconda3/env/my_env
#
# Name                    Version                   Build  Channel
qt                        5.9.7                h5867ecd_1

由于默认频道anaconda中的最新版本qt是5.9.7(https://anaconda.org/anaconda/qt),因此我想要从频道conda-forge安装qt包,该版本为5.12.5(https://anaconda.org/conda-forge/qt)。

因此,我尝试使用以下命令从conda-forge频道安装qt

>>> conda install qt -c conda-forge --override-channels

但是conda没有从新渠道安装qt,并打印出所有软件包都已经安装。
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

顺便提一下,我的.condarc文件中的频道配置是

channels:
  - defaults
  - conda-forge
channel_priority: disabled

为什么conda不更新qt,如何从conda-forge渠道安装qt

您可以在包名前加上频道名称:conda install conda-forge::qt - 您也可以通过 conda install "qt>=5.12" 强制安装特定版本。 - cel
2个回答

2
  1. Your .condarc file is mis-specified if you want conda-forge to take priority. You want this:

    channels:
      - conda-forge
      - defaults
    channel_priority: flexible  # or 'strict'
    
  2. If you want a specific version, try specifying the version in your command. You can even both version and specific build id:

    # This effectively means qt 5.12.*
    conda install -c conda-forge qt=5.12
    
    # You can also specify the exact version and build ID, if you happen to know them:
    conda install -c conda-forge qt=5.12.5=hd8c4c69_1
    

1
我认为来自conda-forge的qt存在依赖问题。
我可以通过升级所有来自conda-forge的软件包来获取qt。
conda upgrade -c conda-forge --all

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接