您的位置:首页 > 运维架构 > Linux

Mac上 CentOS7虚拟机安装Python 2.7.13 |Anaconda 4.4.0 (64-bit)

2017-12-05 12:46 387 查看

Mac上 CentOS7虚拟机安装Python 2.7.13 |Anaconda 4.4.0 (64-bit)

系统:centOS7 Minimal (因为这个里面什么都要重新安装)

在上一篇文章中弄好了远程连接之后,这一篇安装Python 2.7.13 |Anaconda 4.4.0 (64-bit)

那么在安装之前我们需要通过yum来安装一些包,以供等下的下载:

yum install pip  # python安装工具
yum install vim  # 安装vim编译器(不安装直接vi也行)
yum install wget  # 用于从网上下载包
yum install git  # 用于从github上下载包
yum install -y bzip2  # 安装anaconda2的时候需要,不然会报错


下载Anaconda(文件默认保存在当前目录)

wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh[/code] 
输入安装命令

bash Anaconda2-4.4.0-Linux-x86_64.sh


根据提示按ENTER

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
>>>


根据提示输入yes,同意license agreement

... ...
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


直接ENTER键,用默认的安装路径

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] >>>


写入环境变量,直接输入yes (这样就不用手动添加环境变量了)

... ...
installing: zlib-1.2.8-3 ...
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 /root/.bashrc ? [yes|no]
[no] >>> yes


生效.bashrc文件

[root@master tmp]# source ~/.bashrc


输入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 >>>


这样的话就安装成功了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: