从https://repo.continuum.io/archive/index.html上下载对应版本的Anaconda。html
或者到官网:https://www.anaconda.com/download/#linux选择Linux版本下载python
选择好版本后进行下载:linux
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
(下载速度可能会很慢,能够自行使用国内源)bash
Linux下执行:spa
bash Anaconda3-5.0.1-Linux-x86_64.sh
安装过程当中会须要不断回车来阅读并赞成license。code
安装路径默认为用户目录(能够本身指定),最后须要确认将路径加入用户的.bashrc中。htm
最后,当即使路径生效,须要在用户目录下执行:(必定不要忘了执行)blog
source .bashrc
此时,打开python就是最新的3.6版本了。get
为了保持更新,能够在终端中执行:io
conda upgrade --all
若是报下面的错误,极可能是由于设置了PYTHONPATH环境变量。
这将致使Anaconda没法调用正常的本身的库(Anaconda运行不依赖PYTHONPATH环境变量)。
Traceback (most recent call last): File "/home/*****/anaconda3/bin/conda", line 4, in <module> import re File "/home/*****/anaconda3/lib/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'
建议在打开python前执行:
unset PYTHONPATH
或者直接将上述命令一样写入.bashrc文件中并用source生效。
参考:https://www.cnblogs.com/mypath/articles/7877493.html