如何更改现有 conda 虚拟环境的 Python 版本?

我使用 Python 3.8版本创建了一个 conda 环境,但是它不支持 matplotlib... 所以我正在寻找类似这样的东西来更改 Python 版本: conda env my_env update to python=3.6。这可能吗,还是我需要重建环境?

我装了迷你康达。

114889 次浏览

Activate the relevant environment, then install your target python version.

conda activate my_env
conda install python=3.6

Rebuild a new environment, for example called "myenvi"

conda create --name myenvi python=3.6

And make sure the version by

python --version

After installing all packages, double-check with

conda list -n myenvi

Adding to the answer above

conda activate my_env
conda uninstall python
conda install python=x.x

If you already have existing python installation may be in other environment, you can simply use it as base.

Here's what you need to do:

conda activate base
conda install python=3.6

Note: This will activate root environment. and python 3.6 already installed, it will simply replace it.