Centos7安装Anaconda(包管理器 同时共存python2与python3)

Centos7安装Anaconda

 

下载Anaconda

[root@master tmp]# wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh

python3改成下面的最新版本 

wget https://repo.continuum.io/archive/Anaconda3-2018.12-Linux-x86_64.sh 

进入安装文件存放目录

[root@master tmp]# ll
-rw-r--r-- 1 root root 508722275 May 31 03:20 Anaconda2-4.4.0-Linux-x86_64.sh

输入安装命令

[root@master tmp]# bash Anaconda2-4.4.0-Linux-x86_64.sh

python3改成下面的最新版本  

 bash Anaconda3-2018.12-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

python3如下显示 

WARNING:
    You currently have a PYTHONPATH environment variable set. This may cause
    unexpected behavior when running the Python interpreter in Anaconda3.
    For best results, please verify that your PYTHONPATH only points to
    directories of packages that are compatible with the Python interpreter
    in Anaconda3: /root/anaconda3
Do you wish the installer to initialize Anaconda3
in your /root/.bashrc ? [yes|no]

 

这里点yes可能报一大堆错.  但没关系

必须 重开一个terminal终端,你会发现,Centos自带的python2和python3是共存的。

如果不重新打开就行报一大堆错

 

生效.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
>>> 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值