当前位置: 首页 > article >正文

anaconda、miniconda、conda的关系及miniconda安装

anaconda、miniconda、conda的关系及miniconda安装

文章目录

  • 前言
  • 正文
    • 定义
    • 关系
    • Linux安装miniconda
    • 新建一个python3.8环境
  • 参考

前言

本文用于记录关于Anaconda、conda和Miniconda的定义及其关系的总结123

正文

定义

  1. conda
    • 一个跨平台的开源包管理和环境管理工具,支持多种编程语言(不仅是Python),可以安装、更新、删除软件包,并管理不同版本的Python环境。
    • 核心功能包括:
      • 包管理:类似pip,但能处理非Python依赖项(如C/C++库)。
      • 环境隔离:创建独立环境以避免版本冲突,例如同时管理Python 2和Python 3项目。
  2. Anaconda
    • Python科学计算发行版,预装了conda、Python解释器和180+科学计算库(如NumPy、Pandas、Jupyter等),适合数据分析、机器学习等场景。
    • 特点:
      • 开箱即用,省去手动配置依赖的麻烦。
      • 包含图形化界面工具(如Anaconda Navigator)。
      • 体积较大(约3GB),适合存储空间充足的用户。
  3. Miniconda
    • Anaconda的轻量级版本,仅包含conda工具、Python基础环境和必要依赖,不预装其他科学计算库。
    • 特点:
      • 体积小(约50MB),适合对存储敏感或需要自定义环境的用户。
      • 用户可通过conda install按需安装特定包。

关系

  1. 层级关系
    • conda是底层工具,被集成到Anaconda和Miniconda中,负责包和环境管理的核心功能。
    • Anaconda和Miniconda是发行版:
      • Anaconda = conda + Python + 预装科学计算库 + 图形化工具。
      • Miniconda = conda + Python + 基础依赖。
  2. 选择建议
    • 选Anaconda:需要快速开始科学计算项目,且无需手动配置常用库。
    • 选Miniconda:希望最小化安装,或需灵活控制环境(如深度学习框架的多版本切换)。

概览对比表格:

特性condaAnacondaMiniconda
核心功能包与环境管理科学计算发行版(含conda)精简版发行版(含conda)
预装内容180+科学库、图形工具仅conda和Python
体积不适用(集成在发行版)约3GB约50MB
适用场景需通过发行版使用数据分析、机器学习初学者自定义环境开发、资源受限场景

Linux安装miniconda

  1. 下载miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
  1. 运行安装脚本
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh...# 输出及处理:敲回车
Please, press ENTER to continue
>>> ...# 确认版权
Do you accept the license terms? [yes|no]
>>> yes...# 敲回车即可
Miniconda3 will now be installed into this location:
/home/dev/miniconda3- Press ENTER to confirm the location- Press CTRL-C to abort the installation- Or specify a different location below...# 敲回车、默认为no
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:eval "$(/home/dev/miniconda3/bin/conda shell.YOUR_SHELL_NAME hook)" To install conda's shell functions for easier access, first activate, then:conda initThank you for installing Miniconda3!
# 至此安装结束

新建一个python3.8环境

$ conda create --name xCorePy python=3.8Channels:- defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done## Package Plan ##environment location: /home/dev/miniconda3/envs/xCorePyadded / updated specs:- python=3.8The following packages will be downloaded:package                    |            build---------------------------|-----------------pip-24.2                   |   py38h06a4308_0         2.2 MBpython-3.8.20              |       he870216_0        23.8 MBsetuptools-75.1.0          |   py38h06a4308_0         1.7 MBwheel-0.44.0               |   py38h06a4308_0         108 KB------------------------------------------------------------Total:        27.8 MBThe following NEW packages will be INSTALLED:_libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu ca-certificates    pkgs/main/linux-64::ca-certificates-2025.2.25-h06a4308_0 ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.40-h12ee557_0 libffi             pkgs/main/linux-64::libffi-3.4.4-h6a678d5_1 libgcc-ng          pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 libgomp            pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 ncurses            pkgs/main/linux-64::ncurses-6.4-h6a678d5_0 openssl            pkgs/main/linux-64::openssl-3.0.16-h5eee18b_0 pip                pkgs/main/linux-64::pip-24.2-py38h06a4308_0 python             pkgs/main/linux-64::python-3.8.20-he870216_0 readline           pkgs/main/linux-64::readline-8.2-h5eee18b_0 setuptools         pkgs/main/linux-64::setuptools-75.1.0-py38h06a4308_0 sqlite             pkgs/main/linux-64::sqlite-3.45.3-h5eee18b_0 tk                 pkgs/main/linux-64::tk-8.6.14-h39e8969_0 wheel              pkgs/main/linux-64::wheel-0.44.0-py38h06a4308_0 xz                 pkgs/main/linux-64::xz-5.6.4-h5eee18b_1 zlib               pkgs/main/linux-64::zlib-1.2.13-h5eee18b_1 Proceed ([y]/n)? yDownloading and Extracting Packages:Preparing transaction: done                                                                                                                             
Verifying transaction: done                                                                                                                             
Executing transaction: done                                                                                                                             
#
# To activate this environment, use
#
#     $ conda activate xCorePy
#
# To deactivate an active environment, use
#
#     $ conda deactivate

常用指令如下:

conda activate xCorePy  # 激活虚拟环境
conda deactivate  # 离开虚拟环境
conda env list  # 列出虚拟环境
conda info --envs # 列出虚拟环境
conda env remove -n xCorePy  # 删除虚拟环境

配置镜像仓库加速(任意即可)4

# 阿里云
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
# 清华云
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 中科大云
pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple
# 腾讯云
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
# 华为云
pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple

参考


  1. 在 Linux 上安装 Miniconda_linux安装miniconda-CSDN博客 ↩︎

  2. [Python] conda、anaconda、miniconda的关系,miniconda安装,conda命令使用_miniconda和anocanda-CSDN博客 ↩︎

  3. Anaconda常用命令总结,anaconda、conda、miniconda的关系、pip镜像源的处理_anaconda miniconda-CSDN博客 ↩︎

  4. 2025最新 pip install 国内可用镜像源仓库地址(01月01日更新)-腾讯云开发者社区-腾讯云 ↩︎

http://www.lryc.cn/news/2385327.html

相关文章:

  • [C语言初阶]扫雷小游戏
  • 谷歌medgemma-27b-text-it医疗大模型论文速读:多语言大型语言模型医学问答基准测试MedExpQA
  • Lambda表达式的高级用法
  • 速盾(sudun):如何利用CDN技术实现页面加速?
  • DeepSeek+白果AI论文:开启答辩PPT生成的「智能双引擎」时代
  • Jest入门
  • SDC命令详解:使用set_logic_dc命令进行约束
  • 小程序涉及提供提供文本深度合成技术,请补充选择:深度合成-AI问答类目
  • SQL每日一练(2)
  • 基于亚博K210开发板——lvgl 图形化实验
  • LABVIEW 通过节点属性动态改变数值显示控件的方法
  • 信息安全管理与评估2025上海卷
  • el-form 使用el-row el-col对齐 注意事项
  • 使用Terraform创建azure databrick
  • Python爬虫开发基础案例:构建可复用的名言采集系统
  • Spring Boot 中修改 HTTP 响应状态码(即 `response.status`)可以通过以下几种方式实现
  • Linux目录介绍+Redis部署(小白篇)
  • 软件开发MVC三层架构杂谈
  • Python 基础语法速查手册:从入门到精通
  • Spring框架--IOC技术
  • 前端vue2-完全前端生成pdf->pdf-lib,html2canvas+jspdf,原生打印,三种方式(打印带有echarts图的pdf)
  • 论文阅读笔记——Emerging Properties in Unified Multimodal Pretraining
  • JAVA批量发送邮件(含excel内容)
  • Linux(Ubuntu)新建文件权限继承问题
  • Java中的String的常用方法用法总结
  • QGIS如何打开 ARCGIS的mxd工程文件
  • 基于微信小程序的智能问卷调查系统设计与实现(源码+定制+解答)基于微信生态的问卷管理与数据分析系统设计
  • React 如何封装一个可复用的 Ant Design 组件
  • CloudWeGo-Netpoll:高性能NIO网络库浅析
  • Mac的显卡架构种类