version-controlcondaanaconda3

Why doesn't conda version match between conda --version and conda env export?


I would expect that conda env export and conda --version would show the same version number of conda, but they don't.

I am running in wsl with anaconda 2020.11. My base environment has conda=22.9.0, and my test environment has conda=4.9.2 to ensure backwards compatibility with another system. With the test environment activated:

$ conda --version
22.9.0
$ conda env export | grep conda=
  - anaconda=2020.11=py38_0
  - conda=4.9.2=py38h06a4308_0

Finally, here is my conda info:

     active environment : test
    active env location : /home/username/.conda/envs/test
            shell level : 2
       user config file : /home/username/.condarc
 populated config files : /home/username/.condarc
          conda version : 22.9.0
    conda-build version : 3.22.0
         python version : 3.9.13.final.0
       virtual packages : __cuda=12.4=0
                          __linux=5.15.153.1=0
                          __glibc=2.35=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/anaconda3/2022.10  (read only)
      conda av data dir : /opt/anaconda3/2022.10/etc/conda
  conda av metadata url : None
           channel URLs :
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/anaconda3/2022.10/pkgs
                          /home/username/.conda/pkgs
       envs directories : /home/username/.conda/envs
                          /opt/anaconda3/2022.10/envs
               platform : linux-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Linux/5.15.153.1-microsoft-standard-WSL2 ubuntu/22.04.5 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False


Solution

  • You have an older version of conda installed into your test environment. However, when you call conda, you are using the version of conda from your base environment.

    conda env export shows the version of conda in your CURRENT environment.

    conda info returns information about conda in your BASE environment.

    conda --version returns the version of conda in your BASE environment.