简体   繁体   中英

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

I have installed (with lots of troubles) scikits.audiolab for making sounds out of data. Now when I type: import scikits.audiolab I get the following error

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

Check if you have different versions of NumPy installed and try switching back to an older one. 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. 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. 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. So for me it was solved by pip uninstall numy && pip uninstall scipy because that only deleted the newer local versions of 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

The NumPy version I found working for my scikits.audiolab is 1.6.1

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

Hope that helps. :)

Maybe you installed/upgraded numpy after installing talkbox. Try running this command:

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

As suggested here: https://github.com/ppwwyyxx/speaker-recognition/issues/13

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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