linking to audiolab in python2.6 on osx

百般思念 提交于 2019-12-11 11:22:29

问题


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 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.

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


回答1:


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

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

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



来源:https://stackoverflow.com/questions/7919771/linking-to-audiolab-in-python2-6-on-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!