Mee
Mee

Reputation: 1651

how to get anaconda version from conda list anaconda

I am trying to get the anaconda version here, when I run conda list anaconda I get the following result: enter image description here

I want to be able to get the value 2019.10, I am not aware how to do so, I tried to get the type of conda list anaconda to know even how to deal with it, but I get error. Is there a way I can get the version which is 2019.10 here?

Upvotes: 1

Views: 444

Answers (1)

merv
merv

Reputation: 77090

If you just want that string then:

conda list '^anaconda$' | tail -n1 | tr -s' ' | cut -f2 -d' '

or maybe more robust

conda list -e '^anaconda$' | awk -F'=' '!/^#/ {print $2}'

Upvotes: 1

Related Questions