Miniconda的安装及Pytheon3.6环境的搭建及使用

1. 简介

conda是一个开源的包、环境管理器,可以用于在同一个机器上安装不同Python版本的软件包及其依赖,并能够在不同的Python环境之间切换,Anaconda包括Conda、Python以及一大堆安装好的工具包,比如:numpy、pandas等,Miniconda包括Conda、Python。

2. 下载Miniconda(Python3版本)

下载地址:https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
在这里插入图片描述

3. 安装

bash Miniconda3-latest-Linux-x86_64.sh

接受协议

Do you accept the license terms? [yes|no]
[no] >>> yes

在这里插入图片描述

保存文件路径

Miniconda3 will now be installed into this location:
/home/atguigu/miniconda3

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

[/home/atguigu/miniconda3] >>> /opt/module/miniconda3

在这里插入图片描述

初始化

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> yes

在这里插入图片描述

安装成功
Miniconda安装完成后,每次打开终端都会激活其默认的base环境,我们可通过以下命令,禁止激活默认base环境。

界面中的 : conda config --set auto_activate_base false

在这里插入图片描述

重启窗口

在这里插入图片描述

4. 配置环境变量

配置完后 重开窗口

#CONDA_HOME
export CONDA_HOME=/opt/module/miniconda3
export PATH=$PATH:$CONDA_HOOME/bin

在这里插入图片描述

5. 配置Condaa国内镜像

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

显示下载地址:conda config --set show_channel_urls yes

在这里插入图片描述

5. 创建python3.6环境

创建环境:conda create -n env_name
查看所有环境:conda info --envs
删除一个环境:conda remove -n env_name --all

conda create --name superset python=3.6

下图为失败图,原因是网络太差,对没错,我玩不起来了

在这里插入图片描述

6. 激活superset环境

退出环境 conda deactivate

conda activate superset

在这里插入图片描述

7. 查看当前环境的python版本

python

在这里插入图片描述

8. Life

你剥开一个很酸的橙子而感到后悔了 可对于橙子来说 那是它的一切
在这里插入图片描述


版权声明:本文为qq_40180229原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。