简体   繁体   English

如何解决导入声音文件库的操作系统错误

[英]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

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.看起来您的soundfile库安装错误,Python 代码存在,但它只是缺少的本机 dll 的包装器。

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.库的社区和错误跟踪器通常是查找这些问题的更好的地方,而且确实有一个问题表明 pip 20 错误安装了声音文件(和其他),因为它抓取了纯 python 包而不是带有预编译的轮子图书馆。

You may want to either:您可能想要:

  • wait it out等一下
  • explicitly install the proper wheel明确安装合适的轮子
  • downgrade to pip 19.3降级到 pip 19.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM