mamba icon indicating copy to clipboard operation
mamba copied to clipboard

ImportError: libffi.so.7: cannot open shared object file: No such file or directory

Open mictadlo opened this issue 1 year ago • 5 comments

Troubleshooting docs

  • [X] My problem is not solved in the Troubleshooting docs

How did you install Mamba?

Mambaforge

Search tried in issue tracker

ImportError: libffi.so.7

Latest version of Mamba

  • [X] My problem is not solved with the latest version

Tried in Conda?

I have this problem with Conda as well, without using Mamba

Describe your issue

After mamba update mamba, I get

mamba create -n spades3.15.5 spades
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
mamba update mamba

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (0.23.0) supported by @QuantStack

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

█████████████████████████████████████████████████████████████


Looking for: ['mamba']

pkgs/main/linux-64                                            No change
conda-forge/linux-64                                          No change
conda-forge/noarch                                            No change
bioconda/linux-64                                             No change
bioconda/noarch                                               No change
pkgs/r/noarch                                                 No change
pkgs/main/noarch                                              No change
pkgs/r/linux-64                                               No change

Pinned packages:
  - python 3.9.*


Transaction

  Prefix: /home/lorencm/miniconda3

  Updating specs:

   - mamba
   - ca-certificates
   - certifi
   - openssl


  Package                       Version  Build               Channel                    Size
──────────────────────────────────────────────────────────────────────────────────────────────
  Install:
──────────────────────────────────────────────────────────────────────────────────────────────

  + archspec                      0.2.2  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + boltons                      23.0.0  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + conda-libmamba-solver       23.11.1  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + conda-package-streaming       0.9.0  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + fmt                          10.1.1  h00ab1b0_0          conda-forge/linux-64     Cached
  + jsonpatch                      1.33  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + jsonpointer                     2.4  py39hf3d152e_3      conda-forge/linux-64     Cached
  + libnsl                        2.0.1  hd590300_0          conda-forge/linux-64     Cached
  + libsqlite                    3.44.0  h2797004_0          conda-forge/linux-64     Cached
  + libuuid                      2.38.1  h0b41bf4_0          conda-forge/linux-64     Cached
  + packaging                      23.2  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + pluggy                        1.3.0  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + ruamel.yaml                  0.18.5  py39hd1e30aa_0      conda-forge/linux-64     Cached
  + ruamel.yaml.clib              0.2.7  py39hd1e30aa_2      conda-forge/linux-64     Cached
  + zstandard                    0.22.0  py39h6e5214e_0      conda-forge/linux-64     Cached

  Upgrade:
──────────────────────────────────────────────────────────────────────────────────────────────

  - c-ares                       1.18.1  h7f98852_0          conda-forge                    
  + c-ares                       1.21.0  hd590300_0          conda-forge/linux-64     Cached
  - ca-certificates           2021.10.8  ha878542_0          conda-forge                    
  + ca-certificates          2023.11.17  hbcca054_0          conda-forge/linux-64     Cached
  - certifi                   2021.10.8  py39hf3d152e_2      conda-forge                    
  + certifi                  2023.11.17  pyhd8ed1ab_0        conda-forge/noarch       Cached
  - conda                        4.12.0  py39hf3d152e_0      conda-forge                    
  + conda                       23.10.0  py39hf3d152e_1      conda-forge/linux-64     Cached
  - conda-package-handling        1.7.3  py39h27cfd23_1      pkgs/main                      
  + conda-package-handling        2.2.0  pyh38be061_0        conda-forge/noarch       Cached
  - cryptography                 36.0.0  py39h9ce1e76_0      pkgs/main                      
  + cryptography                 41.0.5  py39hd4f0224_0      conda-forge/linux-64     Cached
  - icu                            70.1  h27087fc_0          conda-forge                    
  + icu                            73.2  h59595ed_0          conda-forge/linux-64     Cached
  - krb5                         1.19.3  h3790be6_0          conda-forge                    
  + krb5                         1.21.2  h659d440_0          conda-forge/linux-64     Cached
  - ld_impl_linux-64             2.35.1  h7274673_9          pkgs/main                      
  + ld_impl_linux-64               2.40  h41732ed_0          conda-forge/linux-64     Cached
  - libarchive                    3.5.2  hccf745f_1          conda-forge                    
  + libarchive                    3.7.2  h039dbb9_0          conda-forge/linux-64     Cached
  - libcurl                      7.83.0  h7bff187_0          conda-forge                    
  + libcurl                       8.4.0  hca28451_0          conda-forge/linux-64     Cached
  - libffi                          3.3  he6710b0_2          pkgs/main                      
  + libffi                        3.4.2  h7f98852_5          conda-forge/linux-64     Cached
  - libgcc-ng                    11.2.0  h1d223b6_16         conda-forge                    
  + libgcc-ng                    13.2.0  h807b86a_3          conda-forge/linux-64     Cached
  - libiconv                       1.16  h516909a_0          conda-forge                    
  + libiconv                       1.17  h166bdaf_0          conda-forge/linux-64     Cached
  - libmamba                     0.23.0  hd8a31e3_1          conda-forge                    
  + libmamba                      1.5.3  had39da4_2          conda-forge/linux-64     Cached
  - libmambapy                   0.23.0  py39hd55135b_1      conda-forge                    
  + libmambapy                    1.5.3  py39h10defb6_2      conda-forge/linux-64     Cached
  - libnghttp2                   1.47.0  h727a467_0          conda-forge                    
  + libnghttp2                   1.58.0  h47da74e_0          conda-forge/linux-64     Cached
  - libsolv                      0.7.22  h6239696_0          conda-forge                    
  + libsolv                      0.7.26  hfc55251_0          conda-forge/linux-64     Cached
  - libssh2                      1.10.0  ha56f1ee_2          conda-forge                    
  + libssh2                      1.11.0  h0841786_0          conda-forge/linux-64     Cached
  - libstdcxx-ng                 11.2.0  he4da1e4_16         conda-forge                    
  + libstdcxx-ng                 13.2.0  h7e041cc_3          conda-forge/linux-64     Cached
  - libxml2                      2.9.14  h22db469_0          conda-forge                    
  + libxml2                      2.11.6  h232c23b_0          conda-forge/linux-64     Cached
  - libzlib                      1.2.11  h166bdaf_1014       conda-forge                    
  + libzlib                      1.2.13  hd590300_5          conda-forge/linux-64     Cached
  - mamba                        0.23.0  py39hfa8f2c8_1      conda-forge                    
  + mamba                         1.5.3  py39hc5d2bb1_2      conda-forge/linux-64     Cached
  - openssl                      1.1.1n  h166bdaf_0          conda-forge                    
  + openssl                       3.1.4  hd590300_0          conda-forge/linux-64     Cached
  - pyopenssl                    21.0.0  pyhd3eb1b0_1        pkgs/main                      
  + pyopenssl                    23.3.0  pyhd8ed1ab_0        conda-forge/noarch       Cached
  - python                        3.9.7  h12debd9_1          pkgs/main                      
  + python                       3.9.16  h2782a2a_0_cpython  conda-forge/linux-64     Cached
  - setuptools                   58.0.4  py39h06a4308_0      pkgs/main                      
  + setuptools                   68.2.2  pyhd8ed1ab_0        conda-forge/noarch       Cached
  - tk                           8.6.11  h1ccaba5_0          pkgs/main                      
  + tk                           8.6.13  noxft_h4845f30_101  conda-forge/linux-64     Cached
  - xz                            5.2.5  h7b6447c_0          pkgs/main                      
  + xz                            5.2.6  h166bdaf_0          conda-forge/linux-64     Cached
  - yaml-cpp                      0.6.3  he1b5a44_4          conda-forge                    
  + yaml-cpp                      0.8.0  h59595ed_0          conda-forge/linux-64     Cached
  - zlib                         1.2.11  h166bdaf_1014       conda-forge                    
  + zlib                         1.2.13  hd590300_5          conda-forge/linux-64     Cached
  - zstd                          1.5.2  ha95c52a_0          conda-forge                    
  + zstd                          1.5.5  hfc55251_0          conda-forge/linux-64     Cached

  Summary:

  Install: 15 packages
  Upgrade: 32 packages

  Total download: 0 B

──────────────────────────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done```

### mamba info / micromamba info

```shell
mamba info
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
thread '<unnamed>' panicked at /home/conda/feedstock_root/build_artifacts/cryptography-split_1698192008573/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.18.3/src/err/mod.rs:790:5:
Python API call failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/home/lorencm/miniconda3/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 17, in <module>
    from conda.cli.install import check_prefix, clone, get_revision
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/cli/install.py", line 20, in <module>
    from ..core.index import calculate_channel_urls, get_index
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 24, in <module>
    from .subdir_data import SubdirData, make_feature_record
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 52, in <module>
    from ..trust.signature_verification import signature_verification
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/trust/signature_verification.py", line 13, in <module>
    from conda_content_trust.authentication import verify_delegation, verify_root
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda_content_trust/authentication.py", line 27, in <module>
    import cryptography.exceptions
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
pyo3_runtime.PanicException: Python API call failed

Logs

mamba install -v
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
thread '<unnamed>' panicked at /home/conda/feedstock_root/build_artifacts/cryptography-split_1698192008573/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.18.3/src/err/mod.rs:790:5:
Python API call failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/home/lorencm/miniconda3/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 17, in <module>
    from conda.cli.install import check_prefix, clone, get_revision
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/cli/install.py", line 20, in <module>
    from ..core.index import calculate_channel_urls, get_index
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 24, in <module>
    from .subdir_data import SubdirData, make_feature_record
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 52, in <module>
    from ..trust.signature_verification import signature_verification
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda/trust/signature_verification.py", line 13, in <module>
    from conda_content_trust.authentication import verify_delegation, verify_root
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/conda_content_trust/authentication.py", line 27, in <module>
    import cryptography.exceptions
  File "/home/lorencm/miniconda3/lib/python3.9/site-packages/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
pyo3_runtime.PanicException: Python API call failed

environment.yml

No response

~/.condarc

> cat ~/.condarc
channels:
  - conda-forge
  - bioconda
  - defaults

envs_dirs: 
  - /work/x/miniconda2/envs/

mictadlo avatar Nov 20 '23 05:11 mictadlo

Please read the troubleshooting guide

jonashaag avatar Nov 20 '23 06:11 jonashaag

Unfortunately, I can not find anything in the troubleshooting guide.

mictadlo avatar Nov 21 '23 00:11 mictadlo

Same issue when build with dockerfile.

FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime
# Download from https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
COPY Miniforge3-Linux-x86_64.sh /tmp/Miniforge3-Linux-x86_64.sh
SHELL ["/bin/bash", "-c"]
RUN conda init bash
RUN source "/opt/conda/bin/activate"
RUN conda install python=3.10
RUN bash /tmp/Miniforge3-Linux-x86_64.sh -b
RUN conda install -n base --override-channels -c conda-forge mamba 'python_abi=*=*cp*'
RUN mamba -V

fwwucn avatar Nov 28 '23 07:11 fwwucn

Hmm I don't know if this is supposed to work. You're installing Miniforge over an existing installation of Conda

jonashaag avatar Nov 28 '23 08:11 jonashaag

My issue is resolved with:

FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime

SHELL ["/bin/bash", "-c"]

RUN conda init bash
RUN source "/opt/conda/bin/activate"
RUN conda install -n base --override-channels -c conda-forge libarchive mamba 'python_abi=*=*cp*'
RUN mamba -V

fwwucn avatar Nov 28 '23 09:11 fwwucn