简体   繁体   中英

Specify Python version when cloning base conda environment

I am trying to create a Python 2 environment on Anaconda3 that clones all of the packages from the base environment. I know that conda create --name myenv --clone base creates a clone using the currently acquired version of Python, but is there a way to specify the version when doing this?

So far I have tried specifying the version like conda create --name test_env --clone base python=2.7 but got the error TooManyArgumentsError: did not expect any arguments for --clone Got 1 argument (python=2.7) but expected 0.

You don't need to clone the base in this case. For example, I installed the latest Anaconda with version 3.9, but not everything works with it, I needed Python 3.8.

This worked for me:

conda create -n "py38" python=3.8 anaconda 

From below, you can see that it worked: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM