ImportError:无法导入名称 NumpyTest
我正在尝试使用 scipy 读取 *.wav 文件。我按照以下方式执行此操作:
import scipy.io
x = scipy.io.wavfile.read('/usr/share/sounds/purple/receive.wav')
结果我收到以下错误消息:
Traceback (most recent call last):
File "test3.py", line 1, in <module>
import scipy.io
File "/usr/lib/python2.5/site-packages/scipy/io/__init__.py", line 23, in <module>
from numpy.testing import NumpyTest
ImportError: cannot import name NumpyTest
有谁知道为什么 scipy 无法导入 NumpyTest 以及如何修复它?
I am trying to read a *.wav file using scipy. I do it in the following way:
import scipy.io
x = scipy.io.wavfile.read('/usr/share/sounds/purple/receive.wav')
As a result I get the following error message:
Traceback (most recent call last):
File "test3.py", line 1, in <module>
import scipy.io
File "/usr/lib/python2.5/site-packages/scipy/io/__init__.py", line 23, in <module>
from numpy.testing import NumpyTest
ImportError: cannot import name NumpyTest
Does anybody know why scipy cannot import NumpyTest and how it can be fixed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您已经升级了 numpy 版本,但尚未安装相应的 scipy 版本。
Looks like you have upgraded your numpy version but haven't installed a corresponding scipy version.
你安装了numpy吗?如果您运行的是 Linux,则该软件包很可能称为
numpy
或python-numpy
如果您的操作系统软件包管理器没有 numpy 软件包,请从 此处
Do you have numpy installed? The package is most likely called
numpy
orpython-numpy
if you are running LinuxIf your OS package manager does not have numpy package, download it from here