I had the same issue. In conda < 4.3.0, the timeout was hardcoded to 60 seconds. In Windows, I‘m guessing, that‘s not enough for huge package with a lot of binary
files like qt since most likely the virus scanner kicks in to check the files. You can hack your ~userid\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\fetch.py
and change the hard-coded constant yourself, eg. from 60 to 300.
With newer version (I‘m not sure when this was added, but I see this in my conda 4.3.22), running conda config --show
gave: remote_read_timeout_secs: 60.0
.
So I believe you can modify it by adding it to your ~userid\.condarc
file.
笔者本地的是4.2.0版本Anaconda3-4.2.0-Linux-x86_64.sh
尝试执行命令报错:
conda config --set remote_read_timeout_secs 3600
报错信息:
ubuntu@ubuntu-B85-D3V:~$ conda config --set remote_read_timeout_secs 3600 CondaValueError: Value error: Error key must be one of add_binstar_token, update_dependencies, binstar_upload,
always_copy, anaconda_upload, add_pip_as_python_dependency, allow_other_channels, channel_priority, changeps1, always_yes,
shortcuts, channel_alias, use_pip, auto_update_conda, add_anaconda_token, ssl_verify, client_cert_key, client_cert,
show_channel_urls, offline, allow_softlinks, not remote_read_timeout_secs
也就是当前版本4.2.0还不支持这个remote_read_timeout_secs环境变量设置
笔者在最新版的官方文档上找到超时相关资料,各位可以根据实际情况酌情使用这两个参数:
远程连接超时(默认9.15秒)
# # remote_connect_timeout_secs (float) # # The number seconds conda will wait for your client to establish a # # connection to a remote url resource. # # # remote_connect_timeout_secs: 9.15
远程读取超时(默认60秒)
# # remote_read_timeout_secs (float) # # Once conda has connected to a remote resource and sent an HTTP # # request, the read timeout is the number of seconds conda will wait for # # the server to send a response. # # # remote_read_timeout_secs: 60.0
结论
升级AnaConda版本或者更换镜像源
wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh chmod +x Anaconda3-2019.10-Linux-x86_64.sh
安装过程很简单,一路回车即可
配置环境变量
vim ~/.bashrc
# added by Anaconda3 4.2.0 installer export PATH="/home/ubuntu/anaconda3/bin:$PATH" export CUDA_HOME=/usr/local/cuda-10.2 export PATH="$CUDA_HOME/bin:$PATH" export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
参考来源:https://stackoverflow.com/questions/42797957/changing-timeout-limit-when-using-conda-install
https://docs.conda.io/projects/conda/en/latest/configuration.html