尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

CentOS7安装Miniconda

CentOS7安装Miniconda
📅 发布时间:2026/6/20 2:19:40

CentOS7安装Miniconda

1. 物料包

  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda
操作系统和芯片架构 文件
MacOS Intel Chip Miniconda3-latest-MacOSX-x86_64.sh
MacOS Apple Silicon Miniconda3-latest-MacOSX-arm64.sh
Linux x86_64 Miniconda3-latest-Linux-x86_64.sh
Linux aarch64 Miniconda3-latest-Linux-aarch64.sh
Windows x86_64 Miniconda3-latest-Windows-x86_64.exe

类似产品:

  • https://github.com/conda-forge/miniforge

2. 安装

[yangyunhe@sdp Downloads]$ sh Miniconda3-latest-Linux-x86_64.shWelcome to Miniconda3 py312_25.1.1-2In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue # 按下回车,浏览用户协议,一直按回车
>>> 
ANACONDA TERMS OF SERVICE
...
1. ACCESS & USE
...
2. USERS & LICENSING
...
3. ANACONDA OFFERINGS
...
4. OPEN SOURCE, CONTENT & APPLICATIONS
...
5. CUSTOMER CONTENT, APPLICATIONS & RESPONSIBILITIES
...
6. YOUR DATA, PRIVACY & SECURITY
...
7. SUPPORT
...
8. OWNERSHIP & INTELLECTUAL PROPERTY
...
9. CONFIDENTIAL INFORMATION
...
10. INDEMNIFICATION
...
11. LIMITATION OF LIABILITY
...
12. FEES & PAYMENT
...
13. TERM, TERMINATION & SUSPENSION
...
14. RECORDS, USER COUNT
...
15. GENERAL PROVISIONS
...
16. DEFINITIONS
...
Do you accept the license terms? [yes|no] # 是否同意协议,输入 yes
>>> Please answer 'yes' or 'no':'
>>> yesMiniconda3 will now be installed into this location:
/home/yangyunhe/miniconda3- Press ENTER to confirm the location # 回车确认默认的路径:/home/yangyunhe/miniconda3- Press CTRL-C to abort the installation # CTRL-C 退出安装- Or specify a different location below # 输入安装路径[/home/yangyunhe/miniconda3] >>> # 默认安装的用户 home 目录下,敲回车确认,这里可以手动输入一个其他路径
PREFIX=/home/yangyunhe/miniconda3
Unpacking payload ...Installing base environment... # 安装基础环境
...... installation finished.
Do you wish to update your shell profile to automatically initialize conda? # 是否初始化 conda,输入 yes,否则 conda 无法正常使用
This will activate conda on startup and change the command prompt when activated. # 初始化之后,系统开机后就会激活 conda 并且会改变命令提示符
If you'd prefer that conda's base environment not be activated on startup, # 如果不需要在系统启动之后激活 base 环境,那么在 conda 激活后执行以下命令run the following command when conda is activated:conda config --set auto_activate_base falseYou can undo this by running `conda init --reverse $SHELL`? [yes|no] # 你可以通过执行此命令来退回 conda 初始化操作
[no] >>> yes # 输入 yes
...
Thank you for installing Miniconda3![yangyunhe@sdp Downloads]$# 再次连接终端,命令提示符会改变,base 代表目前的 python 环境是 base
(base) [yangyunhe@sdp ~]$

3. 虚拟环境操作

miniconda 是为当前用户安装的,conda 初始化之后,修改了用户的 .bashrc 文件

if [ $? -eq 0 ]; theneval "$__conda_setup"
elseif [ -f "/home/yangyunhe/miniconda3/etc/profile.d/conda.sh" ]; then. "/home/yangyunhe/miniconda3/etc/profile.d/conda.sh"elseexport PATH="/home/yangyunhe/miniconda3/bin:$PATH"fi
fi
unset __conda_setup
# 查看 python 版本
(base) [yangyunhe@sdp ~]$ python -V
Python 3.12.9# 创建虚拟环境
(base) [yangyunhe@sdp ~]$ conda create -n testenv python=3.11
# 激活虚拟环境
(base) [yangyunhe@sdp ~]$ conda activate testenv
(testenv) [yangyunhe@sdp ~]$# 查看 python 版本
(testenv) [yangyunhe@sdp ~]$ python -V
Python 3.11.11# 查看现有的环境(* 代表目前生效的环境)
(testenv) [yangyunhe@sdp lib]$ conda env list# conda environments:
#
base                   /home/yangyunhe/miniconda3
testenv              * /home/yangyunhe/miniconda3/envs/testenv# 切换环境
(testenv) [yangyunhe@sdp ~]$ conda activate base
(base) [yangyunhe@sdp ~]$# 退出所有 miniconda 环境,返回系统的 python 版本
(base) [yangyunhe@sdp ~]$ conda deactivate
[yangyunhe@sdp ~]$
[yangyunhe@sdp ~]$ python -V
Python 2.7.5# 删除环境
[yangyunhe@sdp ~]$ conda env remove -n testenv# 设置不自动启用 base 环境
[yangyunhe@sdp ~]$ conda config --set auto_activate_base false

4. conda 设置清华大学源

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

~/.condarc 文件

channels:- defaults
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/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
anaconda_channels:- https://repo.anaconda.com/pkgs/main- https://repo.anaconda.com/pkgs/r
auto_activate_base: false
show_channel_urls: true

测试

# .condarc 有两个文件,/home/${user}/.condarc 和 /home/${user}/miniconda3/.condarc
# 都得修改,可以删除 /home/${user}/miniconda3/.condarc
(base) [yangyunhe@sdp ~]$ cp /home/yangyunhe/miniconda3/.condarc /home/yangyunhe/miniconda3/.condarc.bak
(base) [yangyunhe@sdp ~]$ rm -f /home/yangyunhe/miniconda3/.condarc
# 查看源
(base) [yangyunhe@sdp ~]$ conda config --show-sources
==> /home/yangyunhe/.condarc <==
channels:- defaults
custom_channels:conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
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
show_channel_urls: True# 清除索引环境
(base) [yangyunhe@sdp ~]$ conda clean -i
Will remove 1 index cache(s).
Proceed ([y]/n)? y# 安装常用包测试
conda create -n myenv numpy# 删除测试环境
(base) [yangyunhe@sdp ~]$ conda env remove -n myenv

5 pip 设置清华大学源

修改 ~/.pip/pip.conf文件

[yangyunhe@sdp miniconda3]$ mkdir -p ~/.pip
[yangyunhe@sdp miniconda3]$ vim ~/.pip/pip.conf[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn# 校验
[yangyunhe@sdp miniconda3]$ ~/miniconda3/bin/pip config list
global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'
install.trusted-host='pypi.tuna.tsinghua.edu.cn'

相关新闻

  • 102302116 田自豪 作业1
  • 软件测试和DevOps的关系
  • 重组蛋白技术概述

最新新闻

  • 从旋转不变到精准定位:深入解析ESPRIT算法的原理与实现
  • VisualGDB 6.0:解锁Visual Studio跨平台嵌入式与Linux开发新体验
  • 2026 年吉林市厨卫屋顶防水修缮三家对比测评 吉修匠 99.8 分稳居榜首 - 吉修匠
  • 企业境外投资证书丢失怎么登报?2026最新办理流程 - 速递信息
  • 2026 国内论文辅导机构行业盘点:5 家实测机构与甄选攻略 - 艾德思Editsprings
  • 2026 630~650分段人工智能AI专业985高校适配指南:中南大学人工智能领域专业实力解析 - 温茶叙旧

日新闻

  • 信任的进化:技术实现详解——如何用JavaScript构建博弈论模拟器
  • Terrakube自定义工作流:如何集成OPA、Infracost等工具扩展IaC能力
  • grunt-concurrent快速入门:5分钟学会并行运行Grunt任务

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号