conda-forge / libsndfile-feedstock

A conda-smithy repository for libsndfile.
BSD 3-Clause "New" or "Revised" License
2 stars 13 forks source link

pysoundfile fails to import libsndfile, as libvorbis image not found #23

Closed leoauri closed 3 years ago

leoauri commented 3 years ago

Issue: pysoundfile fails to import on 1.0.31-he49afe7_1 but imports without problem on 1.0.30-h046ec9c_1. To reproduce:

conda create -n debug-soundfile
conda activate debug-soundfile
conda install libsndfile=1.0.30 pysoundfile
python -m soundfile

Works.

conda install libsndfile=1.0.31
python -m soundfile

Error:

Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/debug-soundfile/lib/python3.8/site-packages/soundfile.py", line 143, in <module>
    _snd = _ffi.dlopen(_libname)
OSError: cannot load library '/usr/local/anaconda3/envs/debug-soundfile/bin/../lib/libsndfile.dylib': dlopen(/usr/local/anaconda3/envs/debug-soundfile/bin/../lib/libsndfile.dylib, 2): Library not loaded: @rpath/libvorbis.0.4.9.dylib
  Referenced from: /usr/local/anaconda3/envs/debug-soundfile/lib/libsndfile.1.0.31.dylib
  Reason: image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/debug-soundfile/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/anaconda3/envs/debug-soundfile/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/anaconda3/envs/debug-soundfile/lib/python3.8/site-packages/soundfile.py", line 162, in <module>
    _snd = _ffi.dlopen(_os.path.join(
OSError: cannot load library '/usr/local/anaconda3/envs/debug-soundfile/lib/python3.8/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/usr/local/anaconda3/envs/debug-soundfile/lib/python3.8/site-packages/_soundfile_data/libsndfile.dylib, 2): image not found

Originally reported in the pysoundfile feedstock.


Environment (conda list):

``` $ conda list # packages in environment at /usr/local/anaconda3/envs/debug-soundfile: # # Name Version Build Channel blas 1.0 mkl anaconda ca-certificates 2020.10.14 0 anaconda certifi 2020.6.20 py38_0 anaconda cffi 1.14.3 py38hed5b41f_0 anaconda gettext 0.19.8.1 h15daf44_3 anaconda intel-openmp 2020.2 258 anaconda libcxx 11.1.0 habf9029_0 conda-forge libedit 3.1.20191231 h1de35cc_1 anaconda libffi 3.3 hb1e8313_2 anaconda libflac 1.3.3 h046ec9c_1 conda-forge libiconv 1.16 h1de35cc_0 anaconda libogg 1.3.4 h35c211d_1 conda-forge libopus 1.3.1 h1de35cc_0 anaconda libsndfile 1.0.31 he49afe7_1 conda-forge libvorbis 1.3.7 haf1e3a3_0 anaconda mkl 2019.4 233 anaconda mkl-service 2.3.0 py38hfbe908c_0 anaconda mkl_fft 1.2.0 py38hc64f4ea_0 anaconda mkl_random 1.1.1 py38h959d312_0 anaconda ncurses 6.2 h0a44026_1 anaconda numpy 1.19.1 py38h3b9f5b6_0 anaconda numpy-base 1.19.1 py38hcfb5961_0 anaconda openssl 1.1.1h haf1e3a3_0 anaconda pip 20.2.4 py38_0 anaconda pycparser 2.20 py_2 anaconda pysoundfile 0.10.3.post1 pyhd3deb0d_0 conda-forge python 3.8.5 h26836e1_1 anaconda readline 8.0 h1de35cc_0 anaconda setuptools 50.3.0 py38h0dc7051_1 anaconda six 1.15.0 py_0 anaconda sqlite 3.33.0 hffcf06c_0 anaconda tk 8.6.10 hb0a8c7a_0 anaconda wheel 0.35.1 py_0 anaconda xz 5.2.5 h1de35cc_0 anaconda zlib 1.2.11 h1de35cc_3 anaconda ```


Details about conda and system ( conda info ):

``` $ conda info active environment : debug-soundfile active env location : /usr/local/anaconda3/envs/debug-soundfile shell level : 2 user config file : /Users/leoauri/.condarc populated config files : /Users/leoauri/.condarc conda version : 4.9.2 conda-build version : 3.20.5 python version : 3.8.5.final.0 virtual packages : __osx=10.15.7=0 __unix=0=0 __archspec=1=x86_64 base environment : /usr/local/anaconda3 (writable) channel URLs : https://conda.anaconda.org/anaconda/osx-64 https://conda.anaconda.org/anaconda/noarch https://conda.anaconda.org/conda-forge/osx-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/fastai/osx-64 https://conda.anaconda.org/fastai/noarch https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch https://conda.anaconda.org/pytorch/osx-64 https://conda.anaconda.org/pytorch/noarch package cache : /usr/local/anaconda3/pkgs /Users/leoauri/.conda/pkgs envs directories : /usr/local/anaconda3/envs /Users/leoauri/.conda/envs platform : osx-64 user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Darwin/19.6.0 OSX/10.15.7 UID:GID : 501:20 netrc file : None offline mode : False ```
wolfv commented 3 years ago

Hi, from your list I can see that you are mixing channels:

libogg                    1.3.4                h35c211d_1    conda-forge
libopus                   1.3.1                h1de35cc_0    anaconda
libsndfile                1.0.31               he49afe7_1    conda-forge
libvorbis                 1.3.7                haf1e3a3_0    anaconda
mkl                       2019.4                      233    anaconda

All packages should come from teh conda-forge channel. Can you enable strict channel priority?

conda config --add channels conda-forge
conda config --set channel_priority strict
leoauri commented 3 years ago

Thanks, this resolves the issue.