アナコンダ店

アナコンダ店

他のサーバーのyumリポジトリとして使用するrhelサーバーがあります。 Pythonパッケージも提供する必要があります。パッケージをダウンロードするアナコンダリポジトリが見つかりました。https://repo.continuum.io/pkgs/main/linux-64/次のコマンドを使用してすべてのパッケージをダウンロードします。

wget -A bz2  https://repo.continuum.io/pkgs/main/linux-64/ -P /path_for_packages

すべてのパッケージがtar.bz2形式であるため、-A bz2を使用します。

また、インターネットに接続できないがリポジトリサーバーと通信できるクライアントコンピュータもあります。

目的は、サーバーシステムからクライアントシステムにソフトウェアパッケージをインストール/ダウンロードすることです。

両方のサーバーにanaconda 4.5.11があります。また、クライアントコンピュータの「.condarc」ファイルにチャネル(クライアントがパッケージを探すパス)を指定しました。

# This is a sample .condarc file.
# It adds the r Anaconda.org channel and enables
# the show_channel_urls option.

# channel locations. These override conda defaults, i.e., conda will
# search *only* the channels listed here, in the order given.
# Use "defaults" to automatically include all default channels.
# Non-url channels will be interpreted as Anaconda.org usernames
# (this can be changed by modifying the channel_alias key; see below).
# The default is just 'defaults'.
channels:
  - http://<IP_ADDRESS>/Path/To/Packages


# Show channel URLs when displaying what is going to be downloaded
# and in 'conda list'. The default is False.
show_channel_urls: True

# For more information about this file see:
# https://conda.io/docs/user-guide/configuration/use-condarc.html

上記のコマンドを使用してクライアントコンピュータにパッケージをインストールしようとすると、次のようになります。

conda install wget


Solving environment: failed

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

    Traceback (most recent call last):
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 227, in _load
        mod_etag_headers.get('_mod'))
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 574, in fetch_repodata_remote_request
        raise Response304ContentUnchanged()
    conda.core.subdir_data.Response304ContentUnchanged

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/root/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 819, in __call__
        return func(*args, **kwargs)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 78, in _main
        exit_code = do_call(args, p)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 77, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/cli/main_install.py", line 11, in execute
        install(args, parser, 'install')
      File "/root/anaconda3/lib/python3.7/site-packages/conda/cli/install.py", line 235, in install
        force_reinstall=context.force,
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 518, in solve_for_transaction
        force_remove, force_reinstall)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 451, in solve_for_diff
        final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 180, in solve_final_state
        index, r = self._prepare(prepared_specs)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 592, in _prepare
        self.subdirs, prepared_specs)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 215, in get_reduced_index
        new_records = query_all(spec)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 184, in query_all
        return tuple(concat(future.result() for future in as_completed(futures)))
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 95, in query
        self.load()
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 149, in load
        _internal_state = self._load()
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 233, in _load
        mod_etag_headers.get('_mod'))
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 280, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/root/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 320, in _process_raw_repodata_str
        assert subdir == self.channel.subdir
    AssertionError

`$ /root/anaconda3/bin/conda install wget`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/root/anaconda3/bin/conda
             CONDA_PREFIX=/root/anaconda3
    CONDA_PROMPT_MODIFIER=
         CONDA_PYTHON_EXE=/root/anaconda3/bin/python
               CONDA_ROOT=/root/anaconda3
              CONDA_SHLVL=1
                     PATH=/root/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:
                          /root/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : base
    active env location : /root/anaconda3
            shell level : 1
       user config file : /root/.condarc
 populated config files : /root/.condarc
          conda version : 4.5.11
    conda-build version : 3.15.1
         python version : 3.7.0.final.0
       base environment : /root/anaconda3  (writable)
           channel URLs : http://<IP_Address>/Path/To/Packages
                          http://<IP_Address>/Path/To/Packages
          package cache : /root/anaconda3/pkgs
                          /root/.conda/pkgs
       envs directories : /root/anaconda3/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.11 requests/2.19.1 CPython/3.7.0 Linux/3.10.0-327.el7.x86_64 rhel/7.2 glibc/2.17
                UID:GID : 0:0
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
[y/N]: n

No report sent. To permanently opt-out, use

    $ conda config --set report_errors false

私が試したこと:

https://github.com/conda/conda/issues/7524

また、アナコンダ版を「4.3.30」にダウングレードしてみました。このバージョンでは、次の新しいエラーが発生しました。

conda install anaconda
Fetching package metadata .....

CondaEnvironmentNotFoundError: Could not find environment: /root/anaconda3/envs/base .
You can list all discoverable environments with `conda info --envs`.

このエラーは、repo サーバーに次の環境がないことを示します。

http://<IP_Address>/Path/To/Packages

ここにリモート環境を追加することが可能かどうかわかりません。環境を追加する方法は次のとおりです。

 conda  --set custom_channels.my-conda-channel http://<IP_Address>/Path/To/Package

ただし、推測したようにローカルパスのみを追加できます。

ベストアンサー1

Anacondaのバージョンに問題があります。最新バージョンでは、Windowsシステムはリモートリポジトリから必要なパッケージをインストールできません。この問題を解決するには、anaconda3-5.0.1インストーラexeをダウンロードする必要があります。

おすすめ記事