每个版本都有Python2和Python3的版本,这里我们选择python2的版本,对目前大多数软件可用
https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
下载miniconda
#https://conda.io/miniconda.html
wget -c https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
bash Miniconda2-latest-Linux-x86_64.sh
#安装结束后提示添加环境变量,一般选no,否则可能会破坏你之前安装的软件依赖关系。如果你是新用户,没什么软件可破坏的,请选yes添加以后使用更方便。
#如果选择no,每次启动都需要添加一次环境变量
export PATH=/home/jinww/miniconda2/bin:$PATH
conda配置
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
# 添加清华镜像加速下载
site=https://mirrors.tuna.tsinghua.edu.cn/anaconda
conda config --add channels ${site}/pkgs/free/
conda config --add channels ${site}/pkgs/main/
conda config --add channels ${site}/cloud/conda-forge/
conda config --add channels ${site}/pkgs/r/
conda config --add channels ${site}/cloud/bioconda/
conda config --add channels ${site}/cloud/msys2/
conda config --add channels ${site}/cloud/menpo/
conda config --add channels ${site}/cloud/pytorch/
conda指定虚拟环境
#create and install
conda create -n env_name package_name
#举例:conda create -n rna python=2.7
#anaconda使用source;conda使用conda
#activate
source/conda activate env_name
#deactivate:
source/conda deactivate
#其他操作
#查看所有的environmrnts: conda info --envs. 已经激活的会带*号。
#查看某个环境下的安装包有哪些: source activate env_name; conda list
#conda搜索某个安装包:conda search package.name
#用网页搜索包是否存在:[https://bioconda.github.io/search.html?](https://bioconda.github.io/search.html?)
conda安装软件
conda install -y package.name
#-y表示安装过程中弹出是否是否项时统一选择yes
#在某个环境下安装包: source activate env_name; conda install package.name
#指定包版本 conda install package=version
#指定包来源 conda install --channel https://conda.anaconda.org/menpo opencv3
conda卸载软件
conda uninstall package
conda remove package.name
conda更新
#查看己安装软件的版本和依赖关系
conda list -n rna
conda --version
conda update conda
错误情况
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.……
To initialize your shell, run
解决办法:conda deactivate结束之前的环境
参考链接地址
https://www.jianshu.com/p/ff53ed356b34
https://blog.csdn.net/woodcorpse/article/details/82226929
网友评论