scikits audiolab安装错误

Posted

技术标签:

【中文标题】scikits audiolab安装错误【英文标题】:scikits audiolab installation error 【发布时间】:2013-01-11 20:50:08 【问题描述】:

我正在使用 mint Linux Mint 13 maya (linux 3.2.0-23-generic x86-64) 我正在尝试安装 scikits.audiolab 来执行一些音频信号处理。我已经下载了所有先决条件,即(python-dev python-numpy python-setuptools libsndfile-dev)。 我已将 site.cfg 设为

[sndfile]
include_dirs = /usr/include/
library_dirs = /usr/lib/x86_64-linux-gnu/

我收到以下错误

SndfileInfo:
    FOUND:
libraries = ['sndfile']
library_dirs = ['/usr/lib/x86_64-linux-gnu/']
include_dirs = ['/usr/include/']

    AlsaInfo:
libraries asound not found in /usr/local/lib
libraries asound not found in /usr/lib
scikits/audiolab/soundio/setup.py:21: UserWarning: Alsa not found - alsa backend not build
warnings.warn("Alsa not found - alsa backend not build")
CoreAudioInfo:
scikits/audiolab/soundio/setup.py:31: UserWarning: CoreAudio not found - CoreAudio backend not build
warnings.warn("CoreAudio not found - CoreAudio backend not build")

当我执行“$locate asound”时,我得到了

/usr/include/alsa/asoundef.h
/usr/include/alsa/asoundlib.h
/usr/include/alsa/sound/asound_fm.h
/usr/include/linux/ultrasound.h
/usr/include/sound/asound.h
/usr/include/sound/asound_fm.h
/usr/include/sys/asoundlib.h
/usr/include/sys/ultrasound.h
/usr/include/x86_64-linux-gnu/sys/ultrasound.h
/usr/lib/i386-linux-gnu/libasound.so.2
/usr/lib/i386-linux-gnu/libasound.so.2.0.0
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_conf_pulse.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_arcam_av.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_bluetooth.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_oss.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_pulse.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_bluetooth.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_jack.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_oss.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_speex.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_upmix.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_usb_stream.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_vdownmix.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_samplerate.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_samplerate_best.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_samplerate_linear.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_samplerate_medium.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_samplerate_order.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_speexrate_best.so
/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_rate_speexrate_medium.so
/usr/lib/x86_64-linux-gnu/libasound.so
/usr/lib/x86_64-linux-gnu/libasound.so.2
/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_conf_pulse.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_arcam_av.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_bluetooth.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_oss.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_pulse.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_bluetooth.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_jack.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_oss.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_speex.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_upmix.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_usb_stream.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_vdownmix.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_best.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_linear.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_medium.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_order.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate_best.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate_medium.so
/usr/share/doc/libasound2
/usr/share/doc/libasound2-dev
/usr/share/doc/libasound2-plugins
/usr/share/doc/libasound2/NEWS.Debian.gz
/usr/share/doc/libasound2/changelog.Debian.gz
/usr/share/doc/libasound2/copyright
/usr/share/doc/libasound2/examples
/usr/share/doc/libasound2/examples/asoundrc.txt.gz
/usr/share/doc/libasound2-plugins/README-arcam-av
/usr/share/doc/libasound2-plugins/README-jack
/usr/share/doc/libasound2-plugins/README-maemo.gz
/usr/share/doc/libasound2-plugins/README-pcm-oss
/usr/share/doc/libasound2-plugins/README-pulse
/usr/share/doc/libasound2-plugins/a52.txt
/usr/share/doc/libasound2-plugins/changelog.Debian.gz
/usr/share/doc/libasound2-plugins/copyright
/usr/share/doc/libasound2-plugins/examples
/usr/share/doc/libasound2-plugins/lavcrate.txt
/usr/share/doc/libasound2-plugins/samplerate.txt
/usr/share/doc/libasound2-plugins/speexdsp.txt
/usr/share/doc/libasound2-plugins/speexrate.txt
/usr/share/doc/libasound2-plugins/upmix.txt
/usr/share/doc/libasound2-plugins/vdownmix.txt
/usr/share/doc/libasound2-plugins/examples/a52.conf_pulse
/usr/share/doc/libasound2-plugins/examples/asound.conf_jack
/usr/share/doc/libasound2-plugins/examples/asound.conf_oss
/usr/share/local-repository/binary/lib32asound2_1.0.25-1ubuntu10_amd64.deb
/usr/src/linux-headers-3.2.0-23/include/linux/ultrasound.h
/usr/src/linux-headers-3.2.0-23/include/sound/asound.h
/usr/src/linux-headers-3.2.0-23/include/sound/asound_fm.h
/usr/src/linux-headers-3.2.0-23/include/sound/asoundef.h
/usr/src/linux-headers-3.2.0-23/sound/oss/dmasound
/usr/src/linux-headers-3.2.0-23/sound/oss/dmasound/Kconfig
/usr/src/linux-headers-3.2.0-23/sound/oss/dmasound/Makefile
/usr/src/linux-headers-3.2.0-23-generic/include/linux/ultrasound.h
/var/cache/apt/archives/libasound2-dev_1.0.25-1ubuntu10.1_amd64.deb
/var/lib/alsa/asound.state
/var/lib/dpkg/info/libasound2-dev.list
/var/lib/dpkg/info/libasound2-dev.md5sums
/var/lib/dpkg/info/libasound2-dev.postinst
/var/lib/dpkg/info/libasound2-plugins:amd64.list
/var/lib/dpkg/info/libasound2-plugins:amd64.md5sums
/var/lib/dpkg/info/libasound2-plugins:i386.list
/var/lib/dpkg/info/libasound2-plugins:i386.md5sums
/var/lib/dpkg/info/libasound2:amd64.list
/var/lib/dpkg/info/libasound2:amd64.md5sums
/var/lib/dpkg/info/libasound2:amd64.postinst
/var/lib/dpkg/info/libasound2:amd64.postrm
/var/lib/dpkg/info/libasound2:amd64.preinst
/var/lib/dpkg/info/libasound2:amd64.shlibs
/var/lib/dpkg/info/libasound2:amd64.symbols
/var/lib/dpkg/info/libasound2:i386.list
/var/lib/dpkg/info/libasound2:i386.md5sums
/var/lib/dpkg/info/libasound2:i386.postinst
/var/lib/dpkg/info/libasound2:i386.postrm
/var/lib/dpkg/info/libasound2:i386.preinst
/var/lib/dpkg/info/libasound2:i386.shlibs
/var/lib/dpkg/info/libasound2:i386.symbols

如何让 setup.py 找到库。有什么我想念的吗? 我见过http://forum.ubuntu-fr.org/viewtopic.php?pid=3748397和scikits.audiolab on Ubuntu Oneiric - ImportError: No module named _sndfile

这引起了很多挫折

更新

在我的一台 PC 中,完全卸载 scikits-audiolab 和 alsa,然后在重新安装 alsa 和 scikits-audiolab 之前更新 apt-get 后,此错误已消除。

【问题讨论】:

【参考方案1】:

以下内容使 alsa 音频后端可以在 Ubuntu 上为我工作。

按照http://cournape.github.io/audiolab/installing.html#installation-from-sources 中的指示,安装 alsa 标头:

$ sudo apt-get install libasound2-dev

在源目录中,

/path-to/scikits.audiolab-0.11.0/

或者,如果使用 pip(源默认下载到 /tmp)

/tmp/pip-build/scikits.audiolab

创建一个 site.cfg 文件,并在 [sndfile] 部分之外创建一个 [alsa] 部分:

[sndfile]
include_dirs = /usr/include
library_dirs = /usr/lib/x86_64-linux-gnu/
[alsa]
include_dirs = /usr/include/alsa
library_dirs = /usr/lib/x86_64-linux-gnu

使用 locate 或 apt-file list 查找 asoundlib.h (include_dirs) 和 libasound.so (library_dirs) 在系统中的位置。

好吧,在完成所有这些并尝试重新安装之后,它仍然无法正常工作。我不断收到同样令人沮丧的消息:

SndfileInfo:
  FOUND:
    libraries = ['sndfile']
    library_dirs = ['/usr/lib/x86_64-linux-gnu']
    include_dirs = ['/usr/include']

AlsaInfo:
  alsa not found
scikits/audiolab/soundio/setup.py:21: UserWarning: Alsa not found - alsa backend not build
  warnings.warn("Alsa not found - alsa backend not build")

所以,我不得不使用这个 hack。打开文件 /path-to/scikits.audiolab-0.11.0/scikits/audiolab/soundio/setup.py 并替换

14 alsa_info = info_factory('alsa', ['asound'], ['alsa/asoundlib.h'],
15                          classname='AlsaInfo')()

alsa_info = info_factory('alsa', ['asound'], ['asoundlib.h'],
                         classname='AlsaInfo')()

如果这适用于更多人,我们可以要求David Cournapeau(scikits.audiolab 作者)制作此补丁。

【讨论】:

嗨@ravich2_7183,有趣的是你找到了解决这个问题的方法。当我有时间时,我会检查这个补丁/哎呀,现在正忙着做事。过去,我重新安装了很多东西以使 audiolabs 在我的 linuxMint13 上工作。我希望,我当时找到了这样的补丁。

以上是关于scikits audiolab安装错误的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Windows 上安装 scikits.audiolab 0.11.0

scikit-image 安装错误

为啥 pip 在安装 scikit-learn 时会出现权限被拒绝的错误?

Scikit-learn 安装 - 准备元数据 (pyproject.toml) ... 错误

无法在 Macos 错误上安装 Scikit Learn 包 [重复]

Scikit学习导入错误[关闭]