我有一个流变服务器,我使用它作为我的其他服务器的yum存储库。现在,我也需要它来提供python包。我找到了一个用于下载包的anaconda存储库:https://repo.continuum.io/pkgs/main/linux-64/ --我用以下方式下载所有包:
wget -A bz2 https://repo.continuum.io/pkgs/main/linux-64/ -P /path_for_packages我使用-A bz2,因为所有的包都是tar.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:///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=
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=
SSL_CERT_FILE=
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:///Path/To/Packages
http:///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此外,我还试图将我的anaconda版本降级为"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`.从此错误中,它指出回购服务器没有这样的环境,即:
http:///Path/To/Packages我不知道是否可以在这里添加远程环境。我尝试了添加环境的方法:
conda --set custom_channels.my-conda-channel http:///Path/To/Package但正如我所假设的,它可以添加本地路径。
发布于 2019-07-11 10:39:50
Anaconda版本就是问题所在。使用最新版本,windows机器无法从远程存储库安装所需的数据包。为了解决这个问题,您需要下载anaconda3-5.0.1安装程序exe。
https://unix.stackexchange.com/questions/510069
复制相似问题