python多版本管理 Miniconda安装 您所在的位置:网站首页 miniconda安装python python多版本管理 Miniconda安装

python多版本管理 Miniconda安装

2023-08-26 06:00| 来源: 网络整理| 查看: 265

文章目录 前言二、使用步骤1.下载, 使用清华下载源,进入miniconda下载页面2.安装3.使用

前言

开发的程序多了 python的版本比较多 环境比较乱 安装环境miniconda。

# 一、Miniconda 是什么?

Miniconda 是一个 Anaconda 的轻量级替代,默认只包含了 python 和 conda,但是可以通过 pip 和 conda 来安装所需要的包。

二、使用步骤 1.下载, 使用清华下载源,进入miniconda下载页面

代码如下:

​ https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

​ https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh 2.安装

代码如下:

bash Miniconda3-py37_4.8.3-Linux-x86_64.sh

image-20210318100102361

1.In order to continue the installation process, please review the license agreement. Please, press ENTER to continue

**回车**

在这里插入图片描述

***q #退出阅读***

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

image-20210318103809263

yes

3.Miniconda3 will now be installed into this location: /home/aiuser/miniconda3

Press ENTER to confirm the location

Press CTRL-C to abort the installation

Or specify a different location below

image-20210318103946108 回车

4.Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]

image-20210318104128858

no 3.使用

配置清华镜像

vim ~/.condarc #复制以下内容 channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

每次重新进入环境需要

source ~/miniconda3/bin/activate #创建环境 -n 环境名 指定python 版本 conda create -n test python=3.7 #查看当前所有环境 conda info -e #进入环境 conda activate test #退出当前环境 conda deactivate #删除环境 conda env remove -n test # 总结

使用conda非常方便。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有