Ubuntu 16.04 安装Anaconda3

安装包可以从Anaconda官网下载,目前提供了基于Python2.7和Python3.6版本安装包供选择。然而国内的网络环境从官网链接下载奇慢无比,推荐从国内的开源镜像站下载,如清华大学开源软件镜像站,这里我选择下载Anaconda3-5.0.0-Linux-x86_64.sh

3 安装

直接按照官方指南操作即可。
在安装包所在目录执行命令,按Enter继续。由于我需要安装在/opt目录,所以加上了sudo

hj@hj-ubuntu:~/Downloads$ sudo bash Anaconda3-5.0.0-Linux-x86_64.sh 

Welcome to Anaconda3 5.0.0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

接下来提示一些授权信息,输入yes继续。

Do you accept the license terms? [yes|no]
[no] >>> yes
  • 1
  • 2

接下来指定安装目录,不指定的话会安装到默认路径下。

Anaconda3 will now be installed into this location:
/home/hj/anaconda3

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

[/home/hj/anaconda3] >>> /opt/anaconda3
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

然后稍等一会,提示是否要将Anaconda的安装路径添加到PATH环境变量中,输入yes就好了。

installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/hj/.bashrc ? [yes|no]
[no] >>> yes
  • 1
  • 2
  • 3
  • 4

若输入no,需要手动在.bashrc文件中添加以下内容,然后source ~/.bashrc


echo 'export PATH="anaconda3/bin:$PATH"'>> ~/.bashrc
source ~/.bashrc
sudo gedit ~/.bashrc
检查末尾是否已经添加如下变量,没有则添加
export PATH="anaconda3/bin:$PATH"

至此,Anaconda就安装好了

输入以下命令可以开启anaconda-navigator,这里面集成了Anaconda自带的一些工具。

$ anaconda-navigator

猜你喜欢

转载自blog.csdn.net/qq_40213457/article/details/80641270