Ishpreetkaur Dham
Ishpreetkaur Dham

Reputation: 11

How to solve OS Error to import soundfile library

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

Upvotes: 1

Views: 2349

Answers (1)

Masklinn
Masklinn

Reputation: 42462

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

Upvotes: 2

Related Questions