本文介绍了在osx上链接到python2.6中的audiolab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直无法在OS X上使用scikits.audiolab.我尝试了easy_install并从源代码构建,但是两者都给了我相同的错误:

I've been unable to get scikits.audiolab working on OS X. I've tried easy_install and building from source, but both give me the same error:

----> 1 import scikits.audiolab

/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scikits.audiolab-0.11.0-py2.6-macosx-10.3-fat.egg/scikits/audiolab/__init__.py in <module>()
     23 __version__ = _version
     24
---> 25 from pysndfile import formatinfo, sndfile
     26 from pysndfile import supported_format, supported_endianness, \
     27                       supported_encoding, PyaudioException, \

/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scikits.audiolab-0.11.0-py2.6-macosx-10.3-fat.egg/scikits/audiolab/pysndfile/__init__.py in <module>()
----> 1 from _sndfile import Sndfile, Format, available_file_formats, \
      2         available_encodings, sndfile_version
      3 from compat import formatinfo, sndfile, PyaudioException, PyaudioIOError
      4 from compat import supported_format, supported_endianness, supported_encoding

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scikits.audiolab-0.11.0-py2.6-macosx-10.3-fat.egg/scikits/audiolab/pysndfile/_sndfile.so, 2): Symbol not found: _sf_close
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scikits.audiolab-0.11.0-py2.6-macosx-10.3-fat.egg/scikits/audiolab/pysndfile/_sndfile.so
  Expected in: dynamic lookup

_sndfile.so是在它描述的位置创建的,所以据我所知,链接到它是一个奇怪的问题.让我感到难过.我打算放弃Audiolab.

_sndfile.so is created in the location it describes, so it's some weird problem linking to it as, far as I can see. Got me stumped. I'm on the point of abandoning audiolab.

我无法使用内置的scipy方法来加载wav,因为它不适用于24位WAV.

I can't use the built in scipy method for loading wavs as it doesn't work with 24-bit WAVs.

推荐答案

Audiolab需要libsndfile.我已经通过MacPorts安装了它,但是默认情况下它仅以x86_64的形式构建.

Audiolab requires libsndfile. I had installed that via MacPorts, but it had built as x86_64 only by default.

删除所有安装并使用+universal标志重新安装libsndfile,将其构建为i386和x86_64.

Deleting all installs and reinstalling libsndfile with the +universal flag built it as i386 and x86_64.

现在,我可以从源代码安装audiolab,并且它可以正确链接. :)

Now I could install audiolab from source and it linked properly. :)

这篇关于在osx上链接到python2.6中的audiolab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-02 08:41