Python doesn't switch between different each environments in Anaconda.
1
0
Entering edit mode
3.2 years ago
Riku ▴ 80

Hi all.

I had used Python version for diffrent purpose. I just checked Python version in each environment, and same Python version had worked. Even if I created an environment in diffrent version of Python, same version is working.

##example1
$ conda create -n py36 python=3.6
$ conda activate py36
$ python --version
Python 3.6.11

##example2
$ conda create -n py27 python=2.7
$ conda activate py27
$ python --version
Python 3.6.11

##example3
$ conda create -n py38 python=3.8
$ conda activate py38
$ python --version
Python 3.6.11

I had been able to use it before, so I don't know why the problem is occured. After checking with "conda list -n", it seems that the python download was successful. If you know of a solution, could you please tell me it?

Thank you very musch for your help in advance!

Anaconda Python • 1.5k views
ADD COMMENT
0
Entering edit mode

I cannot reproduce this:

##example2
$ conda create -n py27 python=2.7
$ conda activate py27
$ python --version
Python 2.7.15

Are you sure the env was properly activated, so do you see the (py27) rather than (base) in your terminal screen? What is the operating system, the conda version, and is this anaconda or miniconda?

ADD REPLY
0
Entering edit mode

Ah, ok just saw your answer (I toggled it as accepted to provide closure to this thread), corrupted PATHs would be my next guess :)

ADD REPLY
0
Entering edit mode

Very sorry in my careless miss. Thank you for your kindness!

ADD REPLY
0
Entering edit mode

Don't worry. These kinds of little mistakes happen to everyone.

ADD REPLY
1
Entering edit mode
3.2 years ago
Riku ▴ 80

I have solved this problem. Reviewing the paths in ~/.bashrc and removing unnecessary paths solved this problem.

Sorried for my careless miss. Thank you all for your help!

ADD COMMENT

Login before adding your answer.

Traffic: 2490 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6