python中的whosmat属性错误

python中的whosmat属性错误,python,numpy,scipy,Python,Numpy,Scipy,我有一个.mat文件,我想列出此文件的变量: import scipy.io as sio import numpy as np mat_contents = sio.loadmat('dga.mat') #read the .mat file mat_variables = sio.whosmat('dga.mat') #list the variables 我使用scipy.io.whosmat进行了尝试,但收到以下错误: Traceback (most recent call last

我有一个.mat文件,我想列出此文件的变量:

import scipy.io as sio 
import numpy as np
mat_contents = sio.loadmat('dga.mat') #read the .mat file
mat_variables = sio.whosmat('dga.mat') #list the variables
我使用scipy.io.whosmat进行了尝试,但收到以下错误:

Traceback (most recent call last):
  File "dga_data.py", line 6, in <module>
    mat_variables = sio.whosmat('dga.mat')
AttributeError: 'module' object has no attribute 'whosmat'
回溯(最近一次呼叫最后一次):
文件“dga_data.py”,第6行,在
mat_variables=sio.whosmat('dga.mat')
AttributeError:“模块”对象没有属性“whosmat”
我对scipy.io.loadmat和scipy.io.savemat读取和保存文件没有问题。还有人知道为什么它会为scipy.io.whosmat崩溃吗


提前感谢。

这是0.12.0版中的新版本

可能您使用的是旧版本,您可以使用
scipy.\uuuuu version\uuuuuuu
进行检查