安装任何 conda 包 returns python 仅当使用 Artifactory repo 作为通道时出错

Installing any conda package returns python error only when using Artifactory repo as channel

我是一名 Artifactory 管理员,正在尝试制作 Conda 工作流程的原型,以便我们在将 Artifactory 从 5.10 升级到 6.8 时提供用户文档。我已经安装了 conda,并且可以在使用默认频道 (repo.anaconda.com/pkgs/...) 时安装软件包。当我将通道设置为在 Artifactory 中回购时,我希望它能工作。

我为以下对象创建了 4 个远程存储库:

然后我将它们包含在一个名为 'conda-remotes':

的虚拟仓库中

我按照 Artifactory "Set me up" 的说明设置了一个指向我的虚拟仓库的 .condarc 文件。当我 运行 "conda info" 我得到以下输出:

(base) [centos@samuelm-sand ~]$ conda info

     active environment : base
    active env location : /home/centos/anaconda3
            shell level : 1
       user config file : /home/centos/.condarc
 populated config files : /home/centos/.condarc
          conda version : 4.6.14
    conda-build version : not installed
         python version : 2.7.16.final.0
       base environment : /home/centos/anaconda3  (writable)
           channel URLs : https://<<REDACTED>>/api/conda/anaconda-remotes/linux-64
                          https://<<REDACTED>>/api/conda/anaconda-remotes/noarch
          package cache : /home/centos/anaconda3/pkgs
                          /home/centos/.conda/pkgs
       envs directories : /home/centos/anaconda3/envs
                          /home/centos/.conda/envs
               platform : linux-64
             user-agent : conda/4.6.14 requests/2.20.0 CPython/2.7.16 Linux/3.10.0-693.17.1.el7.x86_64 centos/7.4.1708 glibc/2.17
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

当我 运行 'conda install conda-build' 它找到它时,询问我是否要安装,然后它安装依赖项。我可以转到我的 Artifactory 虚拟存储库并查看缓存的依赖项。这是我所期望的,到目前为止工作。然后,一旦下载完所有内容,我就会收到以下错误:

Preparing transaction: failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/exceptions.py", line 1003, in __call__
        return func(*args, **kwargs)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/cli/main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/cli/install.py", line 275, in install
        handle_txn(unlink_link_transaction, prefix, args, newenv)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/cli/install.py", line 304, in handle_txn
        unlink_link_transaction.execute()
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/core/link.py", line 236, in execute
        self.verify()
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/core/link.py", line 213, in verify
        self.prepare()
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/core/link.py", line 205, in prepare
        stp.remove_specs, stp.update_specs)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/core/link.py", line 280, in _prepare
        for prec, pcrec in zip(link_precs, pkg_cache_recs_to_link))
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/core/link.py", line 280, in <genexpr>
        for prec, pcrec in zip(link_precs, pkg_cache_recs_to_link))
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/gateways/disk/read.py", line 104, in read_package_info
        channel=Channel(record.schannel or record.channel),
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/models/channel.py", line 37, in __call__
        c = Channel._cache_[value] = Channel.from_value(value)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/models/channel.py", line 106, in from_value
        return Channel.from_url(path_to_url(value))
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/_vendor/auxlib/decorators.py", line 59, in _memoized_func
        result = func(*args, **kwargs)
      File "/home/centos/anaconda3/lib/python2.7/site-packages/conda/common/url.py", line 119, in path_to_url
        if path[1] == ':':
    IndexError: string index out of range

`$ /home/centos/anaconda3/bin/conda install conda-build`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/home/centos/anaconda3/bin/conda
             CONDA_PREFIX=/home/centos/anaconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/home/centos/anaconda3/bin/python
               CONDA_ROOT=/home/centos/anaconda3
              CONDA_SHLVL=1
                 GEM_PATH=/home/centos/.chefdk/gem/ruby/2.4.0:/opt/chefdk/embedded/lib/ruby/gems
                          /2.4.0
                     PATH=/home/centos/anaconda3/bin:/home/centos/anaconda3/bin:/home/centos/ana
                          conda3/condabin:/opt/chefdk/bin:/home/centos/.chefdk/gem/ruby/2.4.0/bi
                          n:/opt/chefdk/embedded/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/us
                          r/sbin:/opt/chefdk/gitbin:/home/centos/.local/bin:/home/centos/bin:/us
                          r/local/go/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : base
    active env location : /home/centos/anaconda3
            shell level : 1
       user config file : /home/centos/.condarc
 populated config files : /home/centos/.condarc
          conda version : 4.6.14
    conda-build version : not installed
         python version : 2.7.16.final.0
       base environment : /home/centos/anaconda3  (writable)
           channel URLs : https://<<REDACTED>>/api/conda/anaconda-remotes/linux-64
                          https://<<REDACTED>>/api/conda/anaconda-remotes/noarch
          package cache : /home/centos/anaconda3/pkgs
                          /home/centos/.conda/pkgs
       envs directories : /home/centos/anaconda3/envs
                          /home/centos/.conda/envs
               platform : linux-64
             user-agent : conda/4.6.14 requests/2.20.0 CPython/2.7.16 Linux/3.10.0-693.17.1.el7.x86_64 centos/7.4.1708 glibc/2.17
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

我尝试安装的所有东西都发生了完全相同的错误。正如我之前所说,如果我不使用 .condarc 并且只使用默认通道,那么它就可以工作。任何帮助将不胜感激!

我从 jfrog 支持收到这封电子邮件,我的问题似乎是 conda 客户端的错误:

Hi Samuel,

Please be informed that we were able to reproduce the same behavior with the latest conda client. You may refer to the following issue on GitHub (https://github.com/conda/conda/issues/8623) for more information and description - > Latest Conda doesn't work against Artifactory with "conda install". A fix will be included in the upcoming versions of conda client (Fix path_to_url "string index out of range" error #8625).

As a workaround, we suggest using an older conda client version, 4.5.x and below. Please let us know if any further clarifications are needed, we'll be glad to assist.