anaconda 安装教程

简介

Anaconda是一个用于科学计算的Python发行版,支持 Linux, Mac, Windows系统,提供了包管理与环境管理的功能,可以很方便地解决多版本python并存、切换以及各种第三方包安装问题。官网简介

下载

官方下载地址

安装

上传

将Anaconda2-4.4.0-Linux-x86_64.sh上传到系统某文件夹,例如$HOME文件夹。

增加可执行权限

chmod +x Anaconda2-4.4.0-Linux-x86_64.sh

执行安装

执行如下命令开始安装
./Anaconda2-4.4.0-Linux-x86_64.sh

Welcome to Anaconda2 4.4.0 (by Continuum Analytics, Inc.)

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>  

# 输入回车

===================================
Anaconda End User License Agreement
===================================

Copyright 2017, Continuum Analytics, Inc.

All rights reserved under the 3-clause BSD License:

...
...
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
--More--

# 按多次空格进行翻页

kerberos (krb5, non-Windows platforms)
A network authentication protocol designed to provide strong authentication
for client/server applications by using secret-key cryptography.

cryptography
A Python library which exposes cryptographic recipes and primitives.

Do you approve the license terms? [yes|no]
>>> 

# 输入yes,同意license

Anaconda2 will now be installed into this location:
$HOME/anaconda2

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/zhenggang/anaconda2] >>>  

# 输入安装路径,回车;如直接回车,则按默认路径安装

PREFIX=$HOME/anaconda2
installing: python-2.7.13-0 ...
installing: _license-1.1-py27_1 ...
installing: alabaster-0.7.10-py27_0 ...
installing: anaconda-client-1.6.3-py27_0 ...
...
...
installing: anaconda-4.4.0-np112py27_0 ...
installing: conda-4.3.21-py27_0 ...
installing: conda-env-2.6.0-0 ...
Python 2.7.13 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Anaconda2 install location
to PATH in your /vol-th/home/zhenggang/.bashrc ? [yes|no]
[no] >>> 

# 输入yes,则将anaconda的path添加到~/.bashrc文件;
# 输入no,或者直接回车就不会了。

Prepending PATH=$HOME/anaconda2/bin to PATH in /vol-th/home/zhenggang/.bashrc
A backup will be made to: $HOME/.bashrc-anaconda2.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda2!

Share your notebooks and packages on Anaconda Cloud!
Sign up for free: https://anaconda.org

配置使用

哪个python?

如果anaconda的PATH没有添加到~/.bashrc文件中,那么每次使用之前,请在当前终端执行如下命令:

如果已经添加到~/.bashrc中,则每次启动终端后会自动调用该anaconda环境。

执行python

在当前终端执行“python”命令,得到:

Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> 

进阶

如果我们同时安装的了anaconda2和anaconda3,那么可以在~/.bashrc中添加如下命令:

alias py2='export PATH=$HOME/anaconda2/bin:$PATH'
alias py3='export PATH=$HOME/anaconda2/bin:$PATH'

当想使用python2的时候,就输入py2;同理,输入py3。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值