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

12

8

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:

Limassol answered 7/12, 2023 at 6:1 Comment(2)
Have you mixed conda-forge and defaults packages in your base environment?Commeasure
Yes, for a few packages.Limassol
C
6

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

Capitalistic answered 29/2 at 14:39 Comment(1)
Thank you for the answer. I tried this. The output was multiple lists of conflicts for several different packages and then this message in the end: Your installed version is: not available, Note that strict channel priority may have removed packages required for satisfiability. So this, unfortunately did not work for me. Any way to make it work? Am I missing something?Limassol
D
3

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

Fixed it for me.

Disbar answered 7/12, 2023 at 22:5 Comment(3)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Revelation
This is potentially a damaging command for some users (e.g., those who run Miniforge base). This needs clearly stated caveats to be helpful.Commeasure
I ran this command and it did not help me. Didn't seem to hurt either.Limassol
S
3

This works for me:

$ conda install --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive

Eventually install the necessary packages from the same channel (conda -forge).

Screw answered 8/4 at 16:33 Comment(3)
nice! works for me — everything else on here failed! thanks for your new contribution :)Dolly
same - it was very frustrating to randomly encounter this issue, but this solved it like a charm!Haileyhailfellowwellmet
Thank you for the answer. I tried this. The output was multiple lists of conflicts for several different packages and then this message in the end: Your installed version is: not available, Note that strict channel priority may have removed packages required for satisfiability. So this, unfortunately did not work for me. Any way to make it work? Am I missing something?Limassol
A
2

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
Amphipod answered 1/2 at 10:29 Comment(1)
Thanks for mentioning miniforge. I didn't know about it, and it is certainly useful. But I am looking for a solution that does not involve re-installing conda. I'll edit that question to make that clearer.Limassol
S
1

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

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

Stanislas answered 21/2 at 7:3 Comment(1)
In my question I said I set the solver to classic and it didn't solve it. Can you comment on that? Not sure why installing it would result any differentLimassol
P
1

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.

Plaintive answered 3/3 at 14:36 Comment(0)
R
1

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

Rigobertorigor answered 11/3 at 10:20 Comment(0)
S
0

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.

Stockyard answered 3/1 at 2:12 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Revelation
I mentioned "when I reinstall libarchive using channel main, it doesn't update". Do you know how to fix it?Limassol
E
0

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
Ecology answered 21/1 at 11:59 Comment(1)
I was looking for a solution that did not involve reinstalling from scratchLimassol
M
0

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.

Machiavelli answered 18/3 at 10:26 Comment(0)
J
0

I have had a similar problem on Miniconda version 24.3.0
I couldn't even set the solver to classic.

Please refer to this issue.

At the time of writing, copying a simlink in conda_root/lib from libarchive.so to libarchive.so.19 removed the warning and allowed me to execute the commands that weren't allowed.

Note:
This seems to be related to a 'legacy' feature and should be removed later.

Joyance answered 8/4 at 12:43 Comment(0)
D
-1

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.

Disrelish answered 19/2 at 14:44 Comment(1)
I know you are trying to help, but there's an identical answer here already https://mcmap.net/q/190665/-solve-conda-libmamba-solver-libarchive-so-19-error-after-updating-conda-to-23-11-0-without-reinstalling-condaLimassol

© 2022 - 2024 — McMap. All rights reserved.