1、准备
安装前准备:
- 确认有安装python
- 确认有安装vim
- 准备好anaconda安装包
anaconda下载地址
[wutongyu@localhost Documents]$ ls
Anaconda3-5.3.1-Linux-x86_64.sh
2、安装
[wutongyu@localhost Documents]$ bash Anaconda3-5.3.1-Linux-x86_64.sh
Welcome to Anaconda3 5.3.1
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
===================================
Anaconda End User License Agreement
===================================
Copyright 2015, Anaconda, Inc.
......
cryptography
A Python library which exposes cryptographic recipes and primitives.
Do you accept the license terms? [yes|no]
[no] >>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
>>>
Please answer 'yes' or 'no':'
......
注意:在后面选择是否配置路径时,选yes
Do you wish the installer to initialize Anaconda3
in your /home/wutongyu/.bashrc ? [yes|no]
[no] >>> yes
最后会有是否选择安装VSCode,根据个人情况自行选择即可。
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no
3、环境创建
如出现如下情况:
[wutongyu@localhost 环境]$ conda create -n python3_2 python=3
bash: conda: command not found...
有以下问题可能出现上面的问题:
- 未安装python
[wutongyu@localhost Documents]$ sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
[wutongyu@localhost Documents]$ tar -zxvf Python-3.6.5.tgz
[wutongyu@localhost Documents]$ cd Python-3.6.5/
[wutongyu@localhost Documents]$ ./configure && make && make install
[wutongyu@localhost Documents]$ python3
- anaconda未加入到系统路径中
解决:
安装python,并查看 ~/.bashrc 文件下是否有\export PATH="/home/wutongyu/anaconda3/bin:$PATH"
没有的话在最后一行添加路径。然后source,使路径生效
[wutongyu@localhost Python-3.6.5]$ sudo vim ~/.bashrc
[sudo] password for wutongyu:
[wutongyu@localhost Python-3.6.5]$ source ~/.bashrc
[wutongyu@localhost Python-3.6.5]$ anaconda -V
anaconda Command line client (version 1.7.2)
环境创建
[wutongyu@localhost 环境]$ conda create -n python3_2 python=3
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.11
latest version: 4.9.0
Please update conda by running
$ conda update -n base -c defaults conda
......
# 依据提示,使环境生效
# To activate this environment, use
#
# $ conda activate python3_2
#
# To deactivate an active environment, use
#
# $ conda deactivate
[wutongyu@localhost 环境]$ conda activate python3_2
(python3_2) [wutongyu@localhost 环境]$
# 环境搭建成功