Anaconda 安装与使用

  1. Anaconda的下载
    官网
    thu mirror

2.GUI安装 .pkg


image.png

3.如果万一不小心选择了没有添加到环境变量中,需要将我们安装的Anaconda添加到环境变量中
echo "export PATH=/Users/quyue/opt/anaconda3/bin:$PATH">> ~/.bash_profile
mac中的配置文件是.bash_profile; linux中是.bashrc

4.重新载入配置文件

# 重新载入mac Bash的配置文件
source  ~/.bash_profile
# 在重新载入mac Bash的配置文件以后,在命令行中输入
conda

如果成功安装,会出现conda的help内容,如图

$ conda               
usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    clean        Remove unused packages and caches.
    config       Modify configuration values in .condarc. This is modeled
                 after the git config command. Writes to the user .condarc
                 file (/Users/quyue/.condarc) by default.
    create       Create a new conda environment from a list of specified
                 packages.
    help         Displays a list of available conda commands and their help
                 strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda
                 environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment. [Experimental]
    search       Search for packages and display associated information. The
                 input is a MatchSpec, a query language for conda packages.
                 See examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.

  1. 输入“conda list”来查看已经安装的软件:
$ conda list          
# packages in environment at /Users/quyue/opt/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0    defaults
alabaster                 0.7.12                   py37_0    defaults
anaconda                  2019.10                  py37_0    defaults
anaconda-clean            1.1.0                    py37_1    defaults
anaconda-client           1.7.2                    py37_0    defaults
anaconda-navigator        1.9.7                    py37_0    defaults
anaconda-project          0.8.3                      py_0    defaults
appnope                   0.1.0                    py37_0    defaults
appscript                 1.1.0            py37h1de35cc_0    defaults
asn1crypto                1.0.1                    py37_0    defaults
astroid                   2.3.1                    py37_0    defaults
astropy                   3.2.2            py37h1de35cc_0    defaults
atomicwrites              1.3.0                    py37_1    defaults
attrs                     19.2.0                     py_0    defaults
babel                     2.7.0                      py_0    defaults
backcall                  0.1.0                    py37_0    defaults
backports                 1.0                        py_2    defaults
backports.functools_lru_cache 1.5                        py_2    defaults
backports.os              0.1.1                    py37_0    defaults
backports.shutil_get_terminal_size 1.0.0                    py37_2    defaults

6.添加or删除channels
方法一、conda config以后会生成.condarc文件存储配置信息,直接vim ~/.condarc用vim编辑源网址

方法二、添加

官方源
conda config --add channels conda-forge   
conda config --add channels defaults   
conda config --add channels r   
conda config --add channels bioconda
#镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/noarch
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/osx-64
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/osx-64

THU mirror source

方法三、删除

#我输入后显示没有key,所以后来我统一是用vim编辑的
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ 删除channel

方法四、恢复源

conda config --remove-key channels

7.查看已经添加的channels:

conda config --get channels

8.显示每次使用的url

conda config --set show_channel_urls yes    
  1. 查看conda info
conda info          

     active environment : base
    active env location : /Users/quyue/opt/anaconda3
            shell level : 1
       user config file : /Users/quyue/.condarc
 populated config files : /Users/quyue/.condarc
          conda version : 4.8.2
    conda-build version : 3.18.9
         python version : 3.7.4.final.0
       virtual packages : __osx=10.14.3
       base environment : /Users/quyue/opt/anaconda3  (writable)
           channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/osx-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
                          https://conda.anaconda.org/bioconda/osx-64
                          https://conda.anaconda.org/bioconda/noarch
                          https://conda.anaconda.org/r/osx-64
                          https://conda.anaconda.org/r/noarch
                          https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/quyue/opt/anaconda3/pkgs
                          /Users/quyue/.conda/pkgs
       envs directories : /Users/quyue/opt/anaconda3/envs
                          /Users/quyue/.conda/envs
               platform : osx-64
             user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.4 Darwin/18.2.0 OSX/10.14.3
                UID:GID : 501:20
             netrc file : None
           offline mode : False

(base) 

9.Bioconda的使用介绍
herman blog

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容