仅当使用Artifactory回购作为渠道时,安装任何conda软件包才返回python错误(已解决:conda客户端错误)

时间:2019-05-08 20:29:11

标签: conda artifactory

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

我为以下项目创建了4个远程存储库:

然后我将它们包含在称为“ conda-remotes”的虚拟存储库中:

我按照Artifactory的“设置我”说明设置了指向我的虚拟存储库的.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,而仅使用默认通道,则可以使用。任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

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

  

你好塞缪尔,

     

请注意,我们能够使用最新的conda客户端重现相同的行为。   您可以在GitHub(https://github.com/conda/conda/issues/8623)上参考以下问题以获取更多信息和描述->最新的Conda不适用于带有“ conda install”的Artifactory。   即将发布的conda客户端版本中将包含一个修复程序(修复path_to_url“字符串索引超出范围”错误#8625)。

     

作为一种解决方法,我们建议使用较旧的conda客户端版本4.5.x及更低版本。   请让我们知道是否需要进一步澄清,我们将很乐意为您提供帮助。