Solve conda-libmamba-solver (libarchive.so.19) error after updating conda to 23.11.0 without reinstalling conda?

13.1k views Asked by At

After conda update, I am getting the error below after running $ conda, even after setting the solver to classic (using conda config --set solver classic):

Error while loading conda entry point: conda-libmamba-solver (libarchive.so.19: cannot open shared object file: No such file or directory)

I have conda 23.11.0.

On Github there is an issue https://github.com/conda/conda-libmamba-solver/issues/283 in which they mention that if libarchive and libmamba come from the same channel, it should be solved.

But when I reinstall libarchive using channel main, it doesn't update.

Does anyone know how to solve this? I do not want to reinstall Conda from scratch.

Similar links online that do not solve the problem:

10

There are 10 answers

3
A. Catalán On

conda install -n base libarchive -c main --force-reinstall

Fixed it for me.

2
shengjie chen On

I have found the explanation of similiar problem in conda-libmamba-solver/issues/283, and it is noted that is caused by some comflictions that will be fixed in the future. And to solve it now, you should "make sure 'libarchive' and 'libmamba' come from same channel", and my problem finally solved by re-install both packages from main channel.

1
juan felipe beltran diaz On

This has fixed it to me:

  1. Install latest Anaconda distribution (available here: https://www.anaconda.com/products/distribution)
  2. Update conda conda update conda
  3. Install conda-libmamba-solver conda install conda-libmamba-solver
1
Stan Schymanski On

I ended up re-installing mamba from scratch, and now everything works. I followed instructions here and here:

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
1
Ravi On

Try to specify the solver. This will work 100% for sure.

conda install -n base conda-libmamba-solver --solver=classic

1
petercodia On

conda install -n base libarchive -c main --force-reinstall worked for me too.

The comments on the other post note this command can be harmful.

0
iamanigeeit On

This error occurs after installing some packages from conda-forge that depend on libarchive. When you do that, the conda-forge version of libarchive gets you libarchive.so.13.x, which breaks your conda install.

If this error happens in the base env, then I recommend cloning the base env to somewhere else and reinstalling, because the base env should be bare minimum conda anyway.

Otherwise, you can try finding libarchive.so.19 in ~/miniconda3/lib or ~/miniconda3/envs/*/lib and copying all libarchive* files to ~/miniconda3/envs/{YOUR_BROKEN_ENV}/lib.

This is a temp fix. As soon as you can run conda install again, please run conda install -c main conda-mamba-solver libmamba libarchive.

Note: libarchive conda-forge version 13.6 is equivalent to main version 19, but the naming is an open issue.

0
Farlon Souto On

In this specific situation, to prevent walking in circles, you better specify the solver. As suggested, use the classic one:

conda install -n base libarchive -c main --force-reinstall --solver classic

The output you are looking for looks like the following:

Error while loading conda entry point: conda-libmamba-solver (libarchive.so.19: cannot open shared object file: No such file or directory)
Collecting package metadata (current_repodata.json): / WARNING conda.models.version:get_matcher(562): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
Solving environment: done
\## Package Plan ##

  environment location: /home/fsouto/anaconda3

  added / updated specs:
    - libarchive


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2023.12.12 |       h06a4308_0         133 KB  main
    certifi-2024.2.2           |  py311h06a4308_0         161 KB  main
    conda-24.1.2               |  py311h06a4308_0         1.3 MB  main
    libarchive-3.6.2           |       h6ac8c49_2         1.6 MB  main
    ------------------------------------------------------------
                                           Total:         3.1 MB

The following packages will be UPDATED:

  libarchive         conda-forge::libarchive-3.6.2-h3d5159~ --> main::libarchive-3.6.2-h6ac8c49_2 

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    conda-forge::ca-certificates-2024.2.2~ --> main::ca-certificates-2023.12.12-h06a4308_0 
  certifi            conda-forge/noarch::certifi-2024.2.2-~ --> main/linux-64::certifi-2024.2.2-py311h06a4308_0 
  conda              conda-forge::conda-24.1.2-py311h38be0~ --> main::conda-24.1.2-py311h06a4308_0 


Proceed ([y]/n)? y

0
GS.Yen On

While I use conda list, The error comes out: Error while loading conda entry point: conda-libmamba-solver (libarchive.so.19: cannot open shared object file: No such file or directory)

Just use conda install -n base libarchive -c main --force-reinstall --solver classic ,
My system is ubuntu16.04, minconda with py10.
Output as follows:

conda install -n base libarchive -c main --force-reinstall --solver classic
Error while loading conda entry point: conda-libmamba-solver (libarchive.so.19: cannot open shared object file: No such file or directory)
Collecting package metadata (current_repodata.json): \ WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1                                                                                                          done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 23.9.0
  latest version: 24.1.2

Please update conda by running

    $ conda update -n base -c https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge conda

Or to minimize the number of packages updated during conda update use

     conda install conda=24.1.2



## Package Plan ##

  environment location: /data1/rengaosheng/miniconda3

  added / updated specs:
    - libarchive


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2023.12.12 |       h06a4308_0         133 KB  main
    certifi-2024.2.2           |  py310h06a4308_0         161 KB  main
    conda-23.9.0               |  py310h06a4308_0         994 KB  main
    libarchive-3.6.2           |       hb4bd9a0_1         1.6 MB  main
    openssl-1.1.1w             |       h7f8727e_0         3.8 MB  main
    ------------------------------------------------------------
                                           Total:         6.7 MB

The following packages will be UPDATED:

  libarchive         anaconda/cloud/conda-forge::libarchiv~ --> main::libarchive-3.6.2-hb4bd9a0_1

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    anaconda/cloud/conda-forge::ca-certif~ --> main::ca-certificates-2023.12.12-h06a4308_0
  certifi            anaconda/cloud/conda-forge/noarch::ce~ --> main/linux-64::certifi-2024.2.2-py310h06a4308_0
  conda              anaconda/cloud/conda-forge::conda-23.~ --> main::conda-23.9.0-py310h06a4308_0
  openssl            anaconda/cloud/conda-forge::openssl-1~ --> main::openssl-1.1.1w-h7f8727e_0


Proceed ([y]/n)?

After that, everything works well. Good luck

0
timanix On

None of the commands worked for me with the same error as in post. Following the link in this comment I found the solution by user @spyoungtech that was posted there. I will copy-paste it here:

In my case, I was running into this issue even with a fresh conda base environment (via miniconda) because, by default, libarchive is present and installed from the defaults channel. So, when I installed libmamba from conda-forge, this issue occurred due to the mismatching channels.

To fix this, when I create my environment, I make sure to remove the defaults channel then run conda update --all which will cause all packages to be from conda-forge (assuming you have no other channels configured):

# make sure conda-forge is the only channel
conda config --remove channels defaults
conda config --add channels conda-forge

# update all packages to make sure they're from conda-forge, not defaults
conda update --all

After it this issue was resolved for me.