#Anaconda 简介
Anaconda 提供一个管理工具 conda ,可以把 conda 看作是
pip + virtualenv +PVM (Python Version Manager) +
一些必要的底层库,也就是一个更完整也更大的集成管理工具。
一般的搞深度学习的都会用这个工具
Anaconda Navigtor :
用于管理工具包和环境的图形用户界面,后续涉及的众多管理命令也可以在 Navigator 中手工实现。
Jupyter notebook :
基于web的交互式计算环境,可以编辑易于人们阅读的文档,用于展示数据分析的过程。
qtconsole :
一个可执行 IPython 的仿终端图形界面程序,相比 Python Shell 界面,
qtconsole 可以直接显示代码生成的图形,实现多行代码输入执行,以及内置许多有用的功能和函数。
spyder :一个使用Python语言、跨平台的、科学运算集成开发环境。
#安装Anaconda
从官网可以直接下载,有不同平台的安装文件的。这里马哥采用的是Linux平台,
https://www.anaconda.com/download/#linux
这个是linux平台的下载链接 https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh (2018年08月24日更新)
下载之后是一个shell文件,这个文件有几百MB大小,这是个安装文件,文件的前半部分是普通的shell代码,可以用vim打开看的,
文件的后部分都是二进制内容,看不到什么的,这些内容最后会解压缩到你的安装路径下的。
安装 直接执行 这个 Anaconda3-5.2.0-Linux-x86_64.sh 文件进行
如果没有执行权限可以使用chmo 755 Anaconda3-5.2.0-Linux-x86_64.sh 加上执行权限。
然后是 ./Anaconda3-5.2.0-Linux-x86_64.sh 执行
执行过程是交互式的,非常的简单。
最后是设置一下环境变量path,安装的最后会提示你的。
bash 把环境变量配置到 ~/.bashrc 文件中最后 export PATH="$HOME/anaconda3/bin:$PATH".
这里假设你的anaconda3安装到了家目录下面。
zsh 把环境变量配置到 ~/.zshrc 文件中,添加
path=(
$HOME/anaconda3/bin
~/bin
$path
)
安装完之后就可以试试命令是否可以正确执行了
#常用命令
切换环境
activate learn 切换环境,linux需要前面加上个source
列出所有的环境
conda env list
conda upgrade --all 先把所有工具包进行升级
$ conda env -h
usage: conda-env [-h] {
attach,create,export,list,remove,upload,update} ...
positional arguments:
{
attach,create,export,list,remove,upload,update}
attach WARNING: This command is deprecated in conda 4.4 and
scheduled for removal in conda 4.5. Embeds information
describing your conda environment into the notebook
metadata
create Create an environment based on an environment file
export Export a given environment
list List the Conda environments
remove Remove an environment
upload WARNING: This command is deprecated in conda 4.4 and
scheduled for removal in conda 4.5. Upload an
environment to anaconda.org
update Update the current environment based on environment
file
optional arguments:
-h, --help Show this help message and exit.
# 创建新的环境,
$ conda env create --help
usage: conda-env create [-h] [-f FILE] [-n ENVIRONMENT | -p PATH] [-q]
[--force] [--json] [--debug] [--verbose]
[remote_definition]
Create an environment based on an environment file
Options:
positional arguments:
remote_definition remote environment definition / IPython notebook
optional arguments:
-h, --help Show this help message and exit.
-f FILE, --file FILE environment definition file (default: environment.yml)
-n ENVIRONMENT, --name ENVIRONMENT
Name of environment.
-p PATH, --prefix PATH
Full path to environment prefix.
-q, --quiet
--force force creation of environment (removing a previously
existing environment of the same name).
--json Report all output as json. Suitable for using conda