4

conda 更新 python 版本

 2 years ago
source link: https://xujinzh.github.io/2022/05/23/conda-update-python/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

conda 更新 python 版本

2022-05-23technologypython

5 550 1 分钟

当使用 Miniconda 安装 Python 后,除了使用虚拟环境外,有时,我们还需要更新主环境中的 Python 版本,本篇介绍如何更新主环境中的 Python 版本到最新。

当主环境版本不需要大版本更新时

当主环境的 Python 版本不需要大版本更新时,如最初安装的 Python 版本是 3.9.5,现在 Python 官网已经发布了 3.9.13,此时,我们更新小版本到 Anaconda 中的 Python3.9 到最新。

# 首先更新 conda 到最新,测试中如果当前处在 conda activate 状态下,需要更新 conda 两次
conda update conda

# 然后更新 python 到 Anaconda 中的最新。注意,一般 Anaconda 中维护的 python 版本会低于官网最新版
conda install python=3.9

当主环境版本需要大版本更新时

当主环境的 Python 版本需要大版本更新,如最初安装的 Python 版本是 3.9.5,想要更新Python 官网中的最新版 3.10.4,此版本不是稳定版,仍处在 bugfix 阶段,不建议更新。但是,当此版本是稳定版时,可使用如下指定版本的方法更新。

conda update conda

conda update python
# 或指定版本
conda install python=3.10
感谢支持!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK