简体   繁体   English

scikits.audiolab不会导入python(numpy.dtype)

[英]scikits.audiolab doen't import into python (numpy.dtype)

I have installed (with lots of troubles) scikits.audiolab for making sounds out of data. 我已经安装了scikits.audiolab (有很多麻烦)来使数据声音消失。 Now when I type: import scikits.audiolab I get the following error 现在,当我输入: import scikits.audiolab ,出现以下错误

    >>> import scikits.audiolab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/scikits.audiolab-0.11.0-py2.7-macosx-10.7-intel.egg/scikits/audiolab/__init__.py", line 25, in <module>
    from pysndfile import formatinfo, sndfile
  File "/Library/Python/2.7/site-packages/scikits.audiolab-0.11.0-py2.7-macosx-10.7-intel.egg/scikits/audiolab/pysndfile/__init__.py", line 1, in <module>
    from _sndfile import Sndfile, Format, available_file_formats, \
  File "numpy.pxd", line 30, in scikits.audiolab.pysndfile._sndfile (/private/tmp/easy_install-gKE3i5/scikits.audiolab-0.11.0/scikits/audiolab/pysndfile/_sndfile.c:9632)
ValueError: numpy.dtype does not appear to be the correct type object
  1. How do I fix this? 我该如何解决?
  2. Any alternative package that can do the job? 有其他替代软件包可以胜任吗?

I had the same issue and for me it was caused by installing another (more recent) version of NumPy. 我遇到了同样的问题,对我来说,这是由于安装了另一个(较新的)NumPy版本引起的。

Check if you have different versions of NumPy installed and try switching back to an older one. 检查您是否安装了不同版本的NumPy,然后尝试切换回旧版本。 For my part: I had a system-wide installation of Python and common modules like NumPy, which I couldn't touch because I'm not admin on that system. 就我而言:我在系统范围内安装了Python和诸如NumPy之类的通用模块,由于无法在该系统上进行管理,因此无法接触。 So when I installed some other library locally (in ~/.local/lib/python2.7/ ) it would also install more recent versions of SciPy and NumPy and put them into that local folder. 因此,当我在本地安装其他一些库(在~/.local/lib/python2.7/ )时,它也会同时安装SciPy和NumPy的最新版本,并将它们放入该本地文件夹中。 And when importing the module it would draw from the local directory first before looking at the system-wide libraries which were working fine before with scikits.audiolab. 导入模块时,它将首先从本地目录中提取,然后查看系统范围内的库,这些库在使用scikits.audiolab之前运行良好。 So for me it was solved by pip uninstall numy && pip uninstall scipy because that only deleted the newer local versions of numpy. 所以对我来说,它是通过pip uninstall numy && pip uninstall scipy解决的,因为这只会删除较新的本地numpy版本。

But more specific to your case, here is a tutorial how (on a Mac) to switch to a certain version of NumPy: multiple numpy version on Mac OS X 但是,针对您的情况,这里有一个教程(在Mac上)如何切换到特定版本的NumPy: Mac OS X上的多个numpy版本

The NumPy version I found working for my scikits.audiolab is 1.6.1 我发现适用于scikits.audiolab的NumPy版本是1.6.1

>>> import numpy
>>> numpy.version.version
'1.6.1'

Hope that helps. 希望能有所帮助。 :) :)

Maybe you installed/upgraded numpy after installing talkbox. 也许在安装talkbox之后安装了numpy或升级了numpy。 Try running this command: 尝试运行以下命令:

pip install --upgrade --force-reinstall scikits.talkbox

As suggested here: https://github.com/ppwwyyxx/speaker-recognition/issues/13 如此处建议的那样: https : //github.com/ppwwyyxx/speaker-recognition/issues/13

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

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