1

I am struggling to rectify this error

from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import soundfile as sf
Traceback (most recent call last):

  File "<ipython-input-5-ae75db7b0c22>", line 4, in <module>
    import soundfile as sf

  File "...\appdata\local\programs\python\python37\lib\site-packages\soundfile.py", line 163, in <module>
    _path, '_soundfile_data', _libname))

OSError: cannot load library 'c:\users\ishpreet\appdata\local\programs\python\python37\lib\site-packages\_soundfile_data\libsndfile64bit.dll': error 0x7e
rdas
  • 20,604
  • 6
  • 33
  • 46

1 Answers1

2

It looks like your soundfile library is mis-installed, the Python code is present but it's just a wrapper for a native dll which is missing.

The library's community and bug tracker is generally the better place to look for these issues, and indeed it has an issue open indicating that pip 20 mis-installs soundfile (and others) as it grabs the pure-python package instead of the wheel with precompiled libraries.

You may want to either:

  • wait it out
  • explicitly install the proper wheel
  • downgrade to pip 19.3
Masklinn
  • 34,759
  • 3
  • 38
  • 57
  • What is meant by "explicitly install the proper wheel"? – Ben Mar 20 '20 at 10:22
  • Download the correct (binary) wheel package for your platform, then [use pip to install that file specifically](https://stackoverflow.com/a/27909082/8182118). Pip can't grab the wrong package if it doesn't get to choose. – Masklinn Mar 20 '20 at 10:49