Skip to content

OSError: cannot load library 'sndfile.dll': error 0x7e - Windows 10 x64 #13

Closed
@pythonic2020

Description

Using new pysoundfile version 0.10.3.post1, I cannot load conda librosa 0.8.0 on a Win10 x64 machine. The sndfile.dll library cannot be found, even though it installs to the correct place ('C:\Users\me\Miniconda3\envs\py37\Library\bin\sndfile.dll'), perhaps due to the fact that ctypes.util.find_library reports the above location without the "C:" at the start (noticed by @mgeier).

The issue has been discussed extensively here. The same issue occurs in a conda Python 3.8 environment into which pip librosa + dependencies had been previously installed, and then removed.

Here is the dump after trying to import librosa using

import librosa as lr

Click to expand error dump!
OSError                                   Traceback (most recent call last)
~\Miniconda3\envs\py37\lib\site-packages\soundfile.py in <module>
    142         raise OSError('sndfile library not found')
--> 143     _snd = _ffi.dlopen(_libname)
    144 except OSError:

OSError: cannot load library '\Users\me\Miniconda3\envs\py37\Library\bin\sndfile.dll': error 0x7e

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
<ipython-input-33-e06b73cb08df> in <module>
----> 1 import librosa as lr
      2 from glob import glob
      3 

~\Miniconda3\envs\py37\lib\site-packages\librosa\__init__.py in <module>
    209 # And all the librosa sub-modules
    210 from ._cache import cache
--> 211 from . import core
    212 from . import beat
    213 from . import decompose

~\Miniconda3\envs\py37\lib\site-packages\librosa\core\__init__.py in <module>
      4 
      5 from .convert import *  # pylint: disable=wildcard-import
----> 6 from .audio import *  # pylint: disable=wildcard-import
      7 from .spectrum import *  # pylint: disable=wildcard-import
      8 from .pitch import *  # pylint: disable=wildcard-import

~\Miniconda3\envs\py37\lib\site-packages\librosa\core\audio.py in <module>
      6 import warnings
      7 
----> 8 import soundfile as sf
      9 import audioread
     10 import numpy as np

~\Miniconda3\envs\py37\lib\site-packages\soundfile.py in <module>
    161 
    162     _snd = _ffi.dlopen(_os.path.join(
--> 163         _path, '_soundfile_data', _libname))
    164 
    165 __libsndfile_version__ = _ffi.string(_snd.sf_version_string()).decode('utf-8', 'replace')

OSError: cannot load library 'C:\Users\me\Miniconda3\envs\py37\lib\site-packages\_soundfile_data\libsndfile64bit.dll': error 0x7e

conda info

Click to expand conda env info!
 active environment : py37
active env location : C:\Users\me\Miniconda3\envs\py37
        shell level : 3
   user config file : C:\Users\me\.condarc

populated config files : C:\Users\me.condarc
C:\Users\me\Miniconda3\envs\py37.condarc
conda version : 4.9.2
conda-build version : not installed
python version : 3.7.9.final.0
virtual packages : __cuda=11.0=0
__win=0=0
__archspec=1=x86_64
base environment : C:\Users\me\Miniconda3 (writable)
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
https://conda.anaconda.org/conda-py37/win-64
https://conda.anaconda.org/conda-py37/noarch
package cache : C:\Users\me\Miniconda3\pkgs
C:\Users\me.conda\pkgs
C:\Users\me\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\me\Miniconda3\envs
C:\Users\me.conda\envs
C:\Users\me\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.9.2 requests/2.24.0 CPython/3.7.9 Windows/10 Windows/10.0.19041
administrator : False
netrc file : None
offline mode : False

conda list:

Click to expand list of conda packages!
> conda list
# packages in environment at C:\Users\me\Miniconda3\envs\py37:
#
# Name                    Version                   Build  Channel
_tflow_select             2.2.0                     eigen
absl-py                   0.11.0           py37haa95532_0
aiohttp                   3.7.3            py37hcc03f2d_0    conda-forge
alabaster                 0.7.12                   py37_0
appdirs                   1.4.4                      py_0
argh                      0.26.2                   py37_0
argon2-cffi               20.1.0           py37he774522_1
astor                     0.8.1                    py37_0
astroid                   2.4.2                    py37_0
async-timeout             3.0.1                    py37_0
async_generator           1.10             py37h28b3542_0
atomicwrites              1.4.0                      py_0
attrs                     20.3.0             pyhd3eb1b0_0
audioread                 2.1.8            py37hc8dfbb8_3    conda-forge
autopep8                  1.5.4                      py_0
babel                     2.9.0              pyhd3deb0d_0    conda-forge
backcall                  0.2.0                      py_0
bcrypt                    3.2.0            py37he774522_0
beautifulsoup4            4.9.3              pyhb0f4dca_0
black                     20.8b1                     py_1    conda-forge
bleach                    3.2.1                      py_0
blinker                   1.4                      py37_0
blosc                     1.20.1               h7bd577a_0
bokeh                     2.2.3                    py37_0
branca                    0.4.1                      py_0    conda-forge
brotli                    1.0.9                ha925a31_2
brotlipy                  0.7.0           py37h2bbff1b_1003
bs4                       4.9.3                         0
bzip2                     1.0.8                he774522_0
ca-certificates           2020.11.8            h5b45459_0    conda-forge
cached-property           1.5.2                      py_0
cachetools                4.1.1                      py_0
cairo                     1.16.0            hd28d34b_1006    conda-forge
certifi                   2020.11.8        py37haa95532_0
cffi                      1.14.4           py37hcd4344a_0
cfitsio                   3.470                he774522_6
chardet                   3.0.4           py37haa95532_1003
charls                    2.1.0                h33f27b4_2
click                     7.1.2                      py_0
click-plugins             1.1.1                      py_0
cligj                     0.7.1            py37haa95532_0
cloudpickle               1.6.0                      py_0
colorama                  0.4.4                      py_0
cryptography              3.2.1            py37hcd4344a_1
curl                      7.71.1               h4b64cdc_8    conda-forge
cycler                    0.10.0                   py37_0
cytoolz                   0.11.0           py37he774522_0
dask-core                 2.30.0                     py_0
dataclasses               0.7                      py37_0
decorator                 4.4.2                      py_0
defusedxml                0.6.0                      py_0
descartes                 1.1.0                      py_4
diff-match-patch          20200713                   py_0
docutils                  0.16                     py37_1
entrypoints               0.3                      py37_0
expat                     2.2.10               h33f27b4_2
fiona                     1.8.18           py37hc779931_0    conda-forge
flake8                    3.8.4                      py_0
folium                    0.11.0                     py_0    conda-forge
freetype                  2.10.4               hd328e21_0
freexl                    1.0.5                hfa6e2cd_0
future                    0.18.2                   py37_1
fuzzywuzzy                0.18.0             pyhd8ed1ab_0    conda-forge
gast                      0.2.2                    py37_0
gdal                      3.1.4            py37hebdd5d2_0    conda-forge
geopandas                 0.8.1                      py_0
geos                      3.8.1                h33f27b4_0
geotiff                   1.6.0                h8884d1a_3    conda-forge
gettext                   0.19.8.1          h1a89ca6_1005    conda-forge
giflib                    5.2.1                h62dcd97_0
glib                      2.66.3               h0e60522_1    conda-forge
google-auth               1.23.0             pyhd3eb1b0_0
google-auth-oauthlib      0.4.1                      py_2    conda-forge
google-pasta              0.2.0                      py_0
graphviz                  2.38                 hfd603c8_2
grpcio                    1.34.0           py37h04d2302_0    conda-forge
h5py                      3.1.0           nompi_py37h19fda09_100    conda-forge
hdf4                      4.2.13               h712560f_2
hdf5                      1.10.6          nompi_h5268f04_1112    conda-forge
icu                       67.1                 h33f27b4_0    conda-forge
idna                      2.10                       py_0
imagecodecs               2020.5.30        py37hb1be65f_2
imageio                   2.9.0                      py_0
imagesize                 1.2.0                      py_0
importlib-metadata        3.1.1              pyhd8ed1ab_0    conda-forge
importlib_metadata        3.1.1                hd8ed1ab_0    conda-forge
intel-openmp              2020.3             h57928b3_311    conda-forge
intervaltree              3.1.0                      py_0
ipykernel                 5.3.4            py37h5ca1d4c_0
ipympl                    0.5.8                      py_0
ipython                   7.19.0           py37hd4e2768_0
ipython_genutils          0.2.0              pyhd3eb1b0_1
ipywidgets                7.5.1                      py_1
isort                     5.6.4                      py_0
jedi                      0.17.2           py37haa95532_1
jellyfish                 0.8.2                    pypi_0    pypi
jinja2                    2.11.2                     py_0
joblib                    0.17.0                     py_0
jpeg                      9d                   h8ffe710_0    conda-forge
json5                     0.9.5                      py_0
jsonschema                3.2.0                      py_2
jupyter_client            6.1.7                      py_0
jupyter_core              4.7.0            py37haa95532_0
jupyterlab                2.2.9                      py_0    conda-forge
jupyterlab_pygments       0.1.2                      py_0
jupyterlab_server         1.2.0                      py_0
jupyterthemes             0.20.0                     py_1    conda-forge
kealib                    1.4.13               h3b59ab9_1    conda-forge
keras-applications        1.0.8                      py_1
keras-preprocessing       1.1.0                      py_1
keyring                   21.5.0           py37h03978a9_0    conda-forge
kiwisolver                1.3.1            py37h8c56517_0    conda-forge
krb5                      1.17.2               hbae68bd_0    conda-forge
lazy-object-proxy         1.4.3            py37he774522_0
lcms2                     2.11                 hc51a39a_0
lesscpy                   0.13.0                     py_1    conda-forge
libaec                    1.0.4                h33f27b4_1
libblas                   3.8.0                    21_mkl    conda-forge
libboost                  1.67.0               hd9e427e_4
libcblas                  3.8.0                    21_mkl    conda-forge
libclang                  10.0.1          default_hf44288c_1    conda-forge
libcurl                   7.71.1               h4b64cdc_8    conda-forge
libffi                    3.3                  h0e60522_1    conda-forge
libflac                   1.3.3                h0e60522_1    conda-forge
libgdal                   3.1.4                h0e5aa5a_0    conda-forge
libglib                   2.66.3               h8c8e623_1    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
libkml                    1.3.0                he5f2a48_4
liblapack                 3.8.0                    21_mkl    conda-forge
libnetcdf                 4.7.4           nompi_h2ee746f_106    conda-forge
libogg                    1.3.4                h8ffe710_0    conda-forge
libopus                   1.3.1                h8ffe710_1    conda-forge
libpng                    1.6.37               h2a8f88b_0
libpq                     12.3                 hd9aa61d_2    conda-forge
libprotobuf               3.14.0               h23ce68f_0
librosa                   0.8.0              pyh9f0ad1d_0    conda-forge
libsndfile                1.0.30               h0e60522_1    conda-forge
libsodium                 1.0.18               h62dcd97_0
libspatialindex           1.9.3                h33f27b4_0
libspatialite             5.0.0                hf693123_0    conda-forge
libssh2                   1.9.0                h7a1dbc1_1
libtiff                   4.1.0                h56a325e_1
libvorbis                 1.3.7                he774522_0
libwebp-base              1.1.0                he774522_3
libxml2                   2.9.10               hb89e7f3_3
libxslt                   1.1.34               he774522_0
libzopfli                 1.0.3                ha925a31_0
line_profiler             3.1.0            py37hbd76527_1    conda-forge
llvmlite                  0.35.0           py37h34b8924_4
lxml                      4.6.2            py37h9b66d53_0
lz4-c                     1.9.2                hf4a77e7_3
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markdown                  3.3.3            py37haa95532_0
markupsafe                1.1.1            py37hfa6e2cd_1
matplotlib                3.3.3            py37h03978a9_0    conda-forge
matplotlib-base           3.3.3            py37h3379fd5_0    conda-forge
mccabe                    0.6.1                    py37_1
memory_profiler           0.58.0                     py_0
mistune                   0.8.4           py37hfa6e2cd_1001
mkl                       2020.4             hb70f87d_311    conda-forge
mock                      4.0.2                      py_0
more-itertools            8.6.0              pyhd3eb1b0_0
msys2-conda-epoch         20160418                      1
multidict                 5.0.2            py37h2bbff1b_2
munch                     2.5.0                      py_0
mypy_extensions           0.4.3                    py37_0
nbclient                  0.5.1                      py_0
nbconvert                 6.0.7                    py37_0
nbformat                  5.0.8                      py_0
nest-asyncio              1.4.3              pyhd3eb1b0_0
networkx                  2.5                        py_0
nltk                      3.5                        py_0
nodejs                    15.3.0               h57928b3_0    conda-forge
notebook                  6.1.5            py37h03978a9_0    conda-forge
numba                     0.52.0           py37h08fd248_0    conda-forge
numexpr                   2.7.1            py37h414f9d2_3    conda-forge
numpy                     1.19.4           py37hd20adf4_1    conda-forge
numpydoc                  1.1.0              pyhd3eb1b0_1
nxviz                     0.6.2            py37h03978a9_2    conda-forge
oauthlib                  3.1.0                      py_0
olefile                   0.46                     py37_0
openjpeg                  2.3.1                h57dd2e7_3    conda-forge
openssl                   1.1.1h               he774522_0
opt_einsum                3.3.0                      py_0    conda-forge
packaging                 20.7               pyhd3eb1b0_0
palettable                3.3.0                      py_0
pandas                    1.1.4            py37h08fd248_0    conda-forge
pandoc                    2.11.2               h8ffe710_0    conda-forge
pandocfilters             1.4.3            py37haa95532_1
paramiko                  2.7.2                      py_0
parso                     0.7.0                      py_0
pathspec                  0.8.1              pyhd3deb0d_0    conda-forge
pathtools                 0.1.2                      py_1
patsy                     0.5.1                    py37_0
pcre                      8.44                 ha925a31_0
pendulum                  2.1.2              pyhd3eb1b0_1
pexpect                   4.8.0              pyhd3eb1b0_3
pickleshare               0.7.5           pyhd3eb1b0_1003
pillow                    8.0.1            py37h4fa10fc_0
pip                       20.3.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               he774522_0
plotly                    4.13.0             pyhd3eb1b0_0
pluggy                    0.13.1                   py37_0
ply                       3.11                     py37_0
pooch                     1.3.0              pyhd8ed1ab_0    conda-forge
poppler                   0.89.0               h5d62644_1    conda-forge
poppler-data              0.4.10                        0    conda-forge
postgresql                12.3                 he14cc48_2    conda-forge
proj                      7.1.1                h7d85306_3    conda-forge
prometheus_client         0.9.0              pyhd3eb1b0_0
prompt-toolkit            3.0.8                      py_0
protobuf                  3.14.0           py37hf2a7229_0    conda-forge
psutil                    5.7.3            py37h0013d47_0    conda-forge
ptyprocess                0.6.0              pyhd3eb1b0_2
pyasn1                    0.4.8                      py_0
pyasn1-modules            0.2.8                      py_0
pycodestyle               2.6.0                      py_0
pycparser                 2.20                       py_2
pydocstyle                5.1.1                      py_0
pyflakes                  2.2.0                      py_0
pygments                  2.7.2              pyhd3eb1b0_0
pyjwt                     1.7.1                    py37_0
pylint                    2.6.0                    py37_0
pyls-black                0.4.6              pyh9f0ad1d_0    conda-forge
pyls-spyder               0.2.1              pyhd3deb0d_0    conda-forge
pynacl                    1.4.0            py37h62dcd97_1
pyopenssl                 20.0.0             pyhd3eb1b0_1
pyparsing                 2.4.7                      py_0
pyproj                    2.6.1.post1      py37he3b39cb_3    conda-forge
pyqt                      5.12.3           py37h1834ac0_4    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtchart                 5.12                     pypi_0    pypi
pyqtwebengine             5.12.1                   pypi_0    pypi
pyreadline                2.1                      py37_1
pyreadstat                1.0.5            py37h5b38b69_0    conda-forge
pyrsistent                0.17.3           py37he774522_0
pysocks                   1.7.1                    py37_1
pysoundfile               0.10.3.post1       pyhd3deb0d_0    conda-forge
pytables                  3.6.1            py37h14417ae_3    conda-forge
python                    3.7.9                h60c2a47_0
python-dateutil           2.8.1                      py_0
python-graphviz           0.15               pyhd3eb1b0_0
python-jsonrpc-server     0.4.0                      py_0
python-language-server    0.36.1             pyhd3eb1b0_1
python-levenshtein        0.12.0          py37he774522_1001
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2020.4             pyhd3eb1b0_0
pytzdata                  2020.1                     py_0
pywavelets                1.1.1            py37he774522_2
pywin32                   228              py37h4ab8f01_0    conda-forge
pywin32-ctypes            0.2.0                 py37_1001
pywinpty                  0.5.7                    py37_0
pyyaml                    5.3.1            py37he774522_1
pyzmq                     20.0.0           py37hd77b12b_1
qdarkstyle                2.8.1                      py_0
qt                        5.12.9               hb2cf2c5_0    conda-forge
qtawesome                 1.0.1                      py_0
qtconsole                 5.0.1              pyhd8ed1ab_0    conda-forge
qtpy                      1.9.0                      py_0
recordlinkage             0.14                     pypi_0    pypi
regex                     2020.11.13       py37h2bbff1b_0
requests                  2.25.0             pyhd3eb1b0_0
requests-oauthlib         1.3.0                      py_0
resampy                   0.2.2                      py_0    conda-forge
retrying                  1.3.3                    py37_2
rope                      0.18.0                     py_0
rsa                       4.6                        py_0
rtree                     0.9.4            py37h21ff451_1
scikit-image              0.17.2           py37h1e1f486_0
scikit-learn              0.23.2           py37h47e9c7a_0
scipy                     1.5.3            py37h6db1a17_0    conda-forge
seaborn                   0.11.0                     py_0
send2trash                1.5.0                    py37_0
setuptools                50.3.2           py37haa95532_2
shapely                   1.7.1            py37h82f916b_1    conda-forge
six                       1.15.0           py37haa95532_0
sklearn-pandas            2.0.3                    pypi_0    pypi
snappy                    1.1.8                h33f27b4_0
snowballstemmer           2.0.0                      py_0
sortedcontainers          2.3.0              pyhd3eb1b0_0
soupsieve                 2.0.1                      py_0
sphinx                    3.3.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0
sphinxcontrib-devhelp     1.0.2                      py_0
sphinxcontrib-htmlhelp    1.0.3                      py_0
sphinxcontrib-jsmath      1.0.1                      py_0
sphinxcontrib-qthelp      1.0.3                      py_0
sphinxcontrib-serializinghtml 1.1.4                      py_0
spyder                    4.2.0            py37h03978a9_0    conda-forge
spyder-kernels            1.10.0           py37haa95532_0
sqlalchemy                1.3.20           py37h2bbff1b_0
sqlite                    3.34.0               h8ffe710_0    conda-forge
statsmodels               0.12.1           py37h2bbff1b_0
tensorboard               2.4.0              pyhd8ed1ab_0    conda-forge
tensorboard-plugin-wit    1.7.0              pyh9f0ad1d_0    conda-forge
tensorflow                2.1.0           eigen_py37hd727fc0_0
tensorflow-base           2.1.0           eigen_py37h49b2757_0
tensorflow-estimator      2.1.0              pyhd54b08b_0
termcolor                 1.1.0                    py37_1
terminado                 0.9.1                    py37_0
testpath                  0.4.4                      py_0
threadpoolctl             2.1.0              pyh5ca1d4c_0
three-merge               0.1.1              pyh9f0ad1d_0    conda-forge
tifffile                  2020.11.26         pyhd3eb1b0_0
tiledb                    2.1.3                h968eb34_0    conda-forge
tk                        8.6.10               he774522_0
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
toolz                     0.11.1                     py_0
tornado                   6.1              py37h2bbff1b_0
tqdm                      4.54.0             pyhd3eb1b0_0
traitlets                 5.0.5                      py_0
tweepy                    3.9.0              pyh9f0ad1d_0    conda-forge
typed-ast                 1.4.1            py37he774522_0
typing-extensions         3.7.4.3                       0
typing_extensions         3.7.4.3                    py_0
ujson                     4.0.1            py37ha925a31_0
urllib3                   1.25.11                    py_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_3
watchdog                  0.10.4           py37haa95532_0
wcwidth                   0.2.5                      py_0
webencodings              0.5.1                    py37_1
werkzeug                  0.16.1                     py_0
wheel                     0.36.0             pyhd3eb1b0_0
widgetsnbextension        3.5.1                    py37_0
win_inet_pton             1.1.0            py37haa95532_0
wincertstore              0.2                      py37_0
winpty                    0.4.3                         4
wrapt                     1.11.2           py37he774522_0
xerces-c                  3.2.3                ha925a31_0
xgboost                   1.2.1                    pypi_0    pypi
xlrd                      1.2.0                    py37_0
xz                        5.2.5                h62dcd97_0
yaml                      0.2.5                he774522_0
yapf                      0.30.0                     py_0
yarl                      1.6.3            py37h2bbff1b_0
zeromq                    4.3.3                ha925a31_3
zipp                      3.4.0              pyhd3eb1b0_0
zlib                      1.2.11               h62dcd97_4
zstd                      1.4.5                h04227a9_0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions