【问题标题】:audiolab for python 2.7python 2.7 的音频实验室
【发布时间】:2011-11-04 09:31:44
【问题描述】:

我的系统中安装了 python 2.7,我需要使用 audiolab 模块。 我从以下站点下载:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikits.audiolab

当我导入 scikits.audiolab 时,我收到以下错误:

    Traceback (most recent call last):
    File "C:/Python27/trystuff", line 1, in <module>

    from scikits.audiolab import formatinfo as format

     File "C:\Python27\lib\site-packages\scikits\__init__.py", line 1, in <module>

    __import__('pkg_resources').declare_namespace(__name__)

    ImportError: No module named pkg_resources

我该怎么办?

【问题讨论】:

    标签: python python-2.7 python-import scikits


    【解决方案1】:

    这里有一个适用于 python 2.7 的 scikits.audiolab(以及许多其他东西)的 Windows 二进制构建:
    http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikits.audiolab

    audiolab 也需要 libsndfile。链接就在那个页面上,但我也会把它放在这里,因为 libsndfile 很棒:
    http://www.mega-nerd.com/libsndfile/#Download

    PS:您需要将 libsndfile-1.dll 放在 python 可以找到的地方。如果您不介意浪费一点点磁盘空间,可以在 Python27\Lib\site-packages\scikits\audiolab\pysndfile 目录中放置一份副本。

    【讨论】:

    【解决方案2】:

    您需要pkg_resources 模块,它是setup_tools 或更新的fork distribute 的一部分。您链接的站点也有供您安装的 Windows 二进制文件。我推荐分发模块。它们还为您提供轻松安装/卸载第三方模块的功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-05
      • 2015-05-05
      • 2013-12-21
      • 1970-01-01
      • 2022-12-04
      • 2018-01-17
      • 2019-08-02
      相关资源
      最近更新 更多