mamba: [mamba stops working πŸ› οΈ] ImportError: DLL load failed while importing bindings: The specified module could not be found.

Main issue gist

Mamba stops working after installing geopandas (installing geopandas successfully using mamba itself).

How/what went wrong:

Trying to install geospatial, following basic steps in documentation:

  • Creating new env with conda: successful. βœ”οΈ
  • Installing mamba in env using coda: installed successfully and works. βœ”οΈ
  • Installing geopandas in same env using mamba: mamba works and geopandas installed successfully. βœ”οΈ
  • Checking if mamba still works (trying to do anything): Fails. > ImportError: DLL load failed while importing bindings. ❌

Main error:

Happens when executing any mamba commend, demonstrated here through mamba list. (error message is in french but it’s what the issue title says)

(geospatial) PS C:\Users\DELL> mamba list
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\geospatial\Scripts\mamba-script.py", line 6, in <module>
    from mamba.mamba import main
  File "C:\ProgramData\Anaconda3\envs\geospatial\lib\site-packages\mamba\mamba.py", line 49, in <module>
    import libmambapy as api
  File "C:\ProgramData\Anaconda3\envs\geospatial\lib\site-packages\libmambapy\__init__.py", line 7, in <module>
    raise e
  File "C:\ProgramData\Anaconda3\envs\geospatial\lib\site-packages\libmambapy\__init__.py", line 4, in <module>
    from libmambapy.bindings import *  # noqa: F401,F403
ImportError: DLL load failed while importing bindings: La procΓ©dure spΓ©cifiΓ©e est introuvable.
(geospatial) PS C:\Users\DELL>

Additional info:

  • OS: Windows10 (win64)
  • Conda version: 4.13.0
  • Conda-build: 3.21.4
  • Python (env): 3.9.12
  • Mamba 0.24.0
  • Geopandas: 0.9.0

I already faced this very issue the day before, following the same procedure. In this session, I tried to start again from scratch, cleaned up the mess (deleted previous env), started new env and followed same steps and got the same error.

PS: Looked into closed #249 but nothing usefull.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 10
  • Comments: 24 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I faced the same issue when I tried to build a conda package using β€œboa” The command was: conda mambabuild ./conda.recipe/ --output-folder /tmp/__localbuild__/conda/ --no-test -q The error:

Traceback (most recent call last):
  File "/tmp/conda_envs/py37-conda-build/bin/conda-mambabuild", line 6, in <module>
    from boa.cli.mambabuild import main
  File "/tmp/conda_envs/py37-conda-build/lib/python3.7/site-packages/boa/cli/mambabuild.py", line 21, in <module>
    from boa.core.solver import MambaSolver
  File "/tmp/conda_envs/py37-conda-build/lib/python3.7/site-packages/boa/core/solver.py", line 21, in <module>
    import libmambapy
  File "/tmp/conda_envs/py37-conda-build/lib/python3.7/site-packages/libmambapy/__init__.py", line 7, in <module>
    raise e
  File "/tmp/conda_envs/py37-conda-build/lib/python3.7/site-packages/libmambapy/__init__.py", line 4, in <module>
    from libmambapy.bindings import *  # noqa: F401,F403
ImportError: libarchive.so.13: cannot open shared object file: No such file or directory

I compare a healthy environment with the unhealthy environment and there are 3 diffs: healthy vs unhealthy libarchive 3.5.2 hb890918_2 vs libarchive 3.5.2 h5de8990_0 lzo 2.10 vs None tk 8.6.11 h1ccaba5_1 vs tk 8.6.12 h1ccaba5_0

I suspect that somehow the libarchive was corrupted by someone… As a workaround, the following command solved the issue: mamba install libarchive=3.5.2=hb890918_2 -y

Installing mamba 1.4.6, 1.4.7 or 1.4.9 directly triggered the same libarchive.so.13 error for me. However, somehow for me it seems to be working after installing mamba 1.4.5, and then updating to 1.4.9.

conda install 'mamba<=1.4.5' -n base -c conda-forge
conda update mamba -n base -c conda-forge

# At first: conda-forge/linux-64::mamba-1.4.5-py311h3072747_0
# Then: 1.4.5-py311h3072747_0 --> 1.4.9-py311h3072747_0

Note that Conda should not be installed to environments other than base though. See https://mamba.readthedocs.io/en/latest/user_guide/troubleshooting.html#mamba-should-be-installed-to-the-base-environment

Hi everyone, please stop adding new comments that don’t provide any new insights other than you’re also affected. Comments will notify everyone in this thread. Please use emoji reactions instead.

I am currently seeing this issue with both the conda-forge and defaults channel. Running mamba install libarchive=3.5.2=hb890918_2 -y also results in the same error for me. Anyone got any suggestions?

I also experienced the same ImportError: libarchive.so.13: cannot open shared object file: No such file or directory problem.

libarchive from defaults channel seems broken but the one from conda-forge is working.

So this install line resulted in a broken mamba for me: conda install mamba -n base -c defaults -c conda-forge.

But this install line worked (switched channels priority order): conda install mamba -n base -c conda-forge -c defaults.

The side-effect is the entire base env is now updated to conda-forge version. Hope there is no negative effect.

Fix (working) but half measure

I tried removing mamba package and reinstalling it:

  • conda remove mamba: successful βœ”οΈ
  • conda install -c conda-forge mamba: successful βœ”οΈ
  • mamba info: works successful βœ”οΈ

The half mesure:

An anterior version of mamba is installed (mamba 0.15.3) instead of the latest update (mamba 0.24.0) as when mamba was first installed before installing geopandas.

Re-installation log

Click to expand re-installation log

(geospatial) PS C:\Users\DELL> conda remove mamba
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\ProgramData\Anaconda3\envs\geospatial

    - mamba


The following packages will be REMOVED:

  libarchive-3.5.2-h214662b_0
  libmamba-0.24.0-h81a967f_1
  libmambapy-0.24.0-py39h4126fcf_1
  libsolv-0.7.22-h7755175_0
  libzlib-1.2.12-h8ffe710_0
  mamba-0.24.0-py39hb3d9227_1
  pybind11-abi-4-hd8ed1ab_3
  reproc-14.2.4-hd77b12b_1
  reproc-cpp-14.2.4-hd77b12b_1
  yaml-cpp-0.7.0-hd77b12b_1

The following packages will be UPDATED:

  curl                                    7.55.1-h3b839b5_4 --> 7.82.0-h2bbff1b_0
  zlib                  conda-forge::zlib-1.2.12-h8ffe710_0 --> pkgs/main::zlib-1.2.12-h8cc25b3_2

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

  krb5                  conda-forge::krb5-1.19.3-h1176d77_0 --> pkgs/main::krb5-1.19.2-h5b6d351_0
  libcurl            conda-forge::libcurl-7.83.1-h789b8ee_0 --> pkgs/main::libcurl-7.82.0-h86230a5_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(geospatial) PS C:\Users\DELL> conda install -c conda-forge mamba
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##

  environment location: C:\ProgramData\Anaconda3\envs\geospatial

  added / updated specs:
    - mamba


The following NEW packages will be INSTALLED:

  libarchive         conda-forge/win-64::libarchive-3.5.2-hb45042f_1
  libsolv            pkgs/main/win-64::libsolv-0.7.20-h23ce68f_0
  lzo                conda-forge/win-64::lzo-2.10-he774522_1000
  mamba              conda-forge/win-64::mamba-0.15.3-py39h006a82b_0
  reproc             conda-forge/win-64::reproc-14.2.3-h8ffe710_0
  reproc-cpp         conda-forge/win-64::reproc-cpp-14.2.3-h0e60522_0

The following packages will be UPDATED:

  ca-certificates    pkgs/main::ca-certificates-2022.4.26-~ --> conda-forge::ca-certificates-2022.5.18.1-h5b45459_0

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

  certifi            pkgs/main::certifi-2022.5.18.1-py39ha~ --> conda-forge::certifi-2022.5.18.1-py39hcbf5309_0
  openssl              pkgs/main::openssl-1.1.1o-h2bbff1b_0 --> conda-forge::openssl-1.1.1o-h8ffe710_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(geospatial) PS C:\Users\DELL> mamba
menuinst called from non-root env C:\ProgramData\Anaconda3\envs\geospatial
usage: mamba [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    clean        Remove unused packages and caches.
    compare      Compare packages between conda environments.
    config       Modify configuration values in .condarc. This is modeled after the git config command. Writes to the user .condarc file
                 (C:\Users\DELL\.condarc) by default.
    create       Create a new conda environment from a list of specified packages.
    help         Displays a list of available conda commands and their help strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment.
    search       Search for packages and display associated information. The input is a MatchSpec, a query language for conda packages. See
                 examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.
    repoquery    Query repositories using mamba.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

conda commands available from other packages:
  env
(geospatial) PS C:\Users\DELL> mamba info
menuinst called from non-root env C:\ProgramData\Anaconda3\envs\geospatial

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/  /β–ˆβ–ˆ/  /β–ˆβ–ˆ/  /β–ˆβ–ˆ/  /β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
        β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
        β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
        β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘
        β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘
        β•šβ•β•     β•šβ•β•β•šβ•β•  β•šβ•β•β•šβ•β•     β•šβ•β•β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•

        mamba (0.15.3) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ


     active environment : base
    active env location : C:\ProgramData\Anaconda3\envs\geospatial
            shell level : 2
       user config file : C:\Users\DELL\.condarc
 populated config files : C:\Users\DELL\.condarc
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.9.12.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\ProgramData\Anaconda3\envs\geospatial  (writable)
      conda av data dir : C:\ProgramData\Anaconda3\envs\geospatial\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\envs\geospatial\pkgs
                          C:\Users\DELL\.conda\pkgs
                          C:\Users\DELL\AppData\Local\conda\conda\pkgs
       envs directories : C:\ProgramData\Anaconda3\envs\geospatial\envs
                          C:\Users\DELL\.conda\envs
                          C:\Users\DELL\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.12.0 requests/2.24.0 CPython/3.9.12 Windows/10 Windows/10.0.19043
          administrator : True
             netrc file : None
           offline mode : False

(geospatial) PS C:\Users\DELL>