nickeener
nickeener

Reputation: 73

Python version does not change when creating conda environment with different python version

I currently have python3 set as my default python version but I'd like to be able to switch back to python2 for certain things so I created a conda environment with the following command:

conda create -n py2 python=2.7

and then activated it with:

source activate py2

but when I do:

python --version

I still get

Python 3.6.8

What am I doing wrong here? I'm trying to download a conda package this is only python2 compatible but despite being in a python2 environment, it keeps telling me my python version is incompatible.

Upvotes: 6

Views: 4100

Answers (1)

Andrew Lyubovsky
Andrew Lyubovsky

Reputation: 107

You might be running into the issue where you have multiple environments on top of one another.

Try running:

conda deactivate

multiple times in order to exit from all of the environments. Then run:

conda activate py2

Upvotes: 3

Related Questions