测试conda镜像问题
最近(2019-05-08 )很多人反映conda镜像挂掉的问题,所以我有必要给粉丝测试一下:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
代码正常安装即可!
万一你没有把conda添加到环境变量,也可以重新安装,或者修改bashrc咯,我这里测试的用户就是 Ubuntu用户。
no change /home/ubuntu/miniconda3/condabin/conda
no change /home/ubuntu/miniconda3/bin/conda
no change /home/ubuntu/miniconda3/bin/conda-env
no change /home/ubuntu/miniconda3/bin/activate
no change /home/ubuntu/miniconda3/bin/deactivate
no change /home/ubuntu/miniconda3/etc/profile.d/conda.sh
no change /home/ubuntu/miniconda3/etc/fish/conf.d/conda.fish
no change /home/ubuntu/miniconda3/shell/condabin/Conda.psm1
no change /home/ubuntu/miniconda3/shell/condabin/conda-hook.ps1
no change /home/ubuntu/miniconda3/lib/python3.7/site-packages/xonsh/conda.xsh
no change /home/ubuntu/miniconda3/etc/profile.d/conda.csh
modified /home/ubuntu/.bashrc
这个文件被修改的很复杂,一般人可能是看不懂的,当然,也不需要懂。
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/ubuntu/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/ubuntu/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/ubuntu/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ubuntu/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
默认的镜像可以查看: conda config --show channels
conda的base环境可以被抑制
这样就不用担心conda污染我们的系统了
source /home/ubuntu/.bashrc
conda config --set auto_activate_base false
尝试下载安装
首先测试 conda install numpy
发现速度非常棒!
blas pkgs/main/linux-64::blas-1.0-mkl
intel-openmp pkgs/main/linux-64::intel-openmp-2019.3-199
libgfortran-ng pkgs/main/linux-64::libgfortran-ng-7.3.0-hdf63c60_0
mkl pkgs/main/linux-64::mkl-2019.3-199
mkl_fft pkgs/main/linux-64::mkl_fft-1.0.12-py37ha843d7b_0
mkl_random pkgs/main/linux-64::mkl_random-1.0.2-py37hd81dba3_0
numpy pkgs/main/linux-64::numpy-1.16.3-py37h7e9f1db_0
numpy-base pkgs/main/linux-64::numpy-base-1.16.3-py37hde5b4d6_0
这个 mkl-2019.3 | 203.3 MB 都是几秒钟就下载OK了。
再尝试fastqc等生物信息学软件。
conda deactivate
conda create -n qc
conda activate qc
conda info
conda install fastqc -c bioconda
速度也飞快,这个时候我的镜像是:
custom_channels:
pkgs/main: https://repo.anaconda.com
pkgs/free: https://repo.anaconda.com
pkgs/r: https://repo.anaconda.com
pkgs/pro: https://repo.anaconda.com
custom_multichannels:
defaults:
- https://repo.anaconda.com/pkgs/main
- https://repo.anaconda.com/pkgs/free
- https://repo.anaconda.com/pkgs/r
local:
debug: False
default_channels:
- https://repo.anaconda.com/pkgs/main
- https://repo.anaconda.com/pkgs/free
- https://repo.anaconda.com/pkgs/r
default_python: 3.7
尝试修改镜像
首先看看清华镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes
conda config --show channels
conda deactivate
conda create -n qinghua
conda activate qinghua
conda install fastqc -c bioconda
虽然慢了一点,但实际上还是可以使用的!(据说一个月内会停止,请谨慎使用哦)
值得一提的是这个时候安装的是 openjdk-11.0.1
, 而 默认镜像安装的是:openjdk-8.0.152
再 看看腾讯的镜像:
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/free/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/msys2/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/menpo/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/peterjc123/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/main/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
conda config --show channels
conda deactivate
conda create -n tercent -y
conda activate tercent
conda install fastqc -c bioconda
是不可访问的!!
删除已经添加的镜像
既然腾讯镜像错误,那么就需要删除,其实就是编辑 文件 ~/.condarc
即可
conda config --show channels