Ying Xiang Tow
Ying Xiang Tow

Reputation: 85

What is the difference between the python version stated in conda info and that given in conda list?

I created a python environment with the command "conda create py2.7 python=2.7.16" and conda list shows that indeed, the python package installed in this environment is 2.7.16. (1)

However, when I activate this environment and look at the python version, it is 3.7.3.final.0. (Image 2) Does this mean that I did not create my environment properly? If I did, what information does python version give in conda info?

(1)

conda list
Name:   Version:   Build:
...     ...        ...
python  2.7.16     hccbe200_0 

(2)

conda info
active environment : py2.7 
...
python version:3.7.3.final.0

Upvotes: 6

Views: 1900

Answers (1)

merv
merv

Reputation: 76760

Conda includes a conda Python package and this is installed in the base env. When conda info is called, the Python version that is reported is the version that the Conda package is executing under, e.g., sys.version_info (see package code). Hence, it will always report the base env's Python, no matter what env is activated.

If you want to know the Python version of an activated env, then use python --version or conda list '^python$'.

Upvotes: 8

Related Questions