conda update --all fails after fresh install (Anaconda3-2020.11-Linux-x86_64)

Viewed 553

I have a fresh, initialized installation of Anaconda Python from the file Anaconda3-2020.11-Linux-x86_64.sh. Immediately after installation, I run conda update --all and it fails during the "Solving Environment" phase, as shown:

$ conda update --all

Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done

Found conflicts! failed - \ 

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment: 

Specifications: 
- conda-env -> python[version='2.7.*|3.4.*|3.5.*'] 
- navigator-updater -> python[version='2.7.*|3.5.*|3.6.*|3.4.*'] 

Your python: python=3.8 

After that, it lists the - defaults/* for various packages and ultimately cannot go further. Does anyone have insights on what might be going on here?


Conda Info

$ conda info

    active environment : None 
      user config file : /home/user/.condarc 
populated config files : 
         conda version : 4.9.2 
   conda-build version : 3.20.5 
        python version : 3.8.5.final.0 
      virtual packages : __glibc=2.17=0 
                         __unix=0=0  
                         __archspec=1=x86_64 
      base environment : /usr/local/anaconda38 
          channel URLs : repo.anaconda.com/pkgs/main/linux-64 
                         repo.anaconda.com/pkgs/main/noarch 
                         repo.anaconda.com/pkgs/r/linux-64 
                         repo.anaconda.com/pkgs/r/noarch 
         package cache : /usr/local/anaconda38/pkgs /home/user/.conda/pkgs 
      envs directories : /home/user/.conda/envs 
                         /usr/local/anaconda38/envs 
              platform : linux-64 
            user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Linux/3.10.0-957.5.1.el7.x86_64 centos/7.6.1810 glibc/2.17 
               UID:GID : 722097580:1044000513 
            netrc file : None
          offline mode : False
1 Answers

Possible Old Conda Leaking into Environment

The presence of the conda-env package in the conflict report is indicative of this not being a completely fresh install. Specifically, that package was merged into the main conda Python package starting with Conda v4.2.0 (in 2016!) and so should no longer exist as a standalone package. This is possibly a relic from a previous Conda installation or something that may have been installed via pip, perhaps at a user lever (i.e., pip install --user).

This also means that some other Python installation or at least a site-packages is leaking into the environment, which can interfere with Conda's expected behavior. Normal Conda environment functionality assumes full isolation of environments.

Suggested Resolution

Try to establish where the conda-env package is installed and remove it. One can get of list of where Python is sourcing packages from using

python -c 'import sys; print(sys.path)'

Anything coming from outside the Anaconda 3 installation would be a leak. Additionally, remove any other packages that might be installed at a user-level (typically at ~/.local/lib/python*.*/site-packages), since Python will always attempt to load from there if a matching Python version is present. In your specific case, you want to check the v3.8 subdirectory, but generally one should avoid any user-level package installation (see Using Pip in a Conda Environment).

Another potential route of leakage is through PYTHONPATH. Ensure that this is not set.

Related