如何安装部署Anaconda2?

Python

1 基础知识

1.1 Anaconda的版本

– Anaconda Enterprise版
– Anaconda Distribution版
– Anaconda Cloud版

1.2 Anaconda Enterprise

Anaconda Enterprise是一个企业级,安全且可扩展的数据科学平台,使团队能够管理数据科学资产,协作和部署数据科学项目。
详细的功能如下,
– 使用API轻松将项目部署到交互式数据库应用程序,实时笔记本和机器学习模型
– 与同事和合作者共享此应用程序
– 管理数据科学资产,包括笔记本电脑、软件包、环境和项目和提供综合数据科学体验

1.3 Anaconda Distribution

Anaconda Distribution是一个免费,易于安装的软件包管理器,环境管理器和Python发行版,包含1,000多个开源软件包,并提供免费社区支持。
以下平台均可使用,
– Windows
– MacOS
– Linux

1.4 Anaconda Cloud

Anaconda Cloud是一种包管理服务,可以轻松查找,访问,存储和共享公共笔记本和环境,以及conda和PyPI包。

2 最佳实践

2.1 安装解压工具

yum install -y bzip2

注:后面安装包需要使用

2.2 下载指定版本

cd ~
wget https://repo.continuum.io/archive/Anaconda2-5.2.0-Linux-x86_64.sh

注意:其他版本请从以下链接中下载,
https://repo.continuum.io/archive/

2.3 安装指定版本

bash ~/Anaconda2-5.2.0-Linux-x86_64.sh

可根据如下向导配置,

Please, press ENTER to continue
>>>
[...]
Do you accept the license terms? [yes|no]
[no] >>> yes

Anaconda2 will now be installed into this location:
/root/anaconda2

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

[/root/anaconda2] >>> /usr/anaconda2
[...]
Do you wish the installer to prepend the Anaconda2 install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>> no
[...]
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no

如果遇到如下错误提示,

/root/Anaconda2-5.2.0-Linux-x86_64.sh: line 350: bunzip2: command not found

你可能需要安装如下包解决依赖关系,

yum install -y bzip2

如果遇到如下错误提示,

ERROR: File or directory already exists: '/usr/anaconda2'

你需要运行时使用“-u”参数去覆盖升级,

bash ~/Anaconda2-5.2.0-Linux-x86_64.sh -u

2.4 配置环境变量

vim /etc/profile.d/anaconda2.sh

可加入如下行定义环境变量,

# added by Anaconda2 installer
export ANACONDA2_HOME=/usr/anaconda2/
export PATH=${ANACONDA2_HOME}/bin:$PATH

通过如下命令使环境变量立刻生效,

source /etc/profile

2.5 测试安装

python
>>> import pandas
>>> quit()

另外,也可以使用如下命令确认,

conda list | grep anaconda

参阅文档
=================================================================

官方首页
—————
https://docs.anaconda.com/anaconda/install/linux

软件的下载
—————
https://repo.continuum.io/archive/

没有评论

发表回复

FTP & SFTP & FTPS
如何使用Python连接FTP?

1 前言 一个问题,一篇文章,一出故事。 笔者遇到一个需要使用Python连接ftp的需求,于是整理 …

Python
如何安装部署pysmb?

1 基础知识 pysmb是一个实验性的SMB/CIFS库 pysmb用Python编写 pysmb实 …

Python
如何安装部署Anaconda3?

1 基础知识 1.1 Anaconda的版本 – Anaconda Enterprise …