Python 停止在 loadmat 上工作 [英] Python stops working on loadmat

查看:40
本文介绍了Python 停止在 loadmat 上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 SciPy 的 loadmat 时遇到问题.虽然 savemat 似乎工作正常,但当我尝试加载任何 .mat 文件时,整个 python 只是停止工作,甚至没有抛出错误.我正在使用带有 scipy 0.17.0 的 anaconda2 发行版(python 2.7).

I'm having trouble using SciPy's loadmat. while savemat seems to work fine, when I try to load any .mat file, the whole python simply stops working without even throwing an error. I'm using anaconda2 distro (python 2.7) with scipy 0.17.0.

from scipy import io
dict_a = {'a':[3, 9, 17, 15, 19]}
io.savemat('example.mat', dict_a)

mat = io.loadmat('example.mat')

这个例子在最后一行使 python 崩溃.我很高兴有任何想法.

This example crashes the python on the last line. I would be glad for any ideas.

推荐答案

问题似乎是Anaconda 2.5.0版本有问题,降级到Anaconda 2.4.1(或升级到Anaconda3)loadmat工作正常.

The trouble seems to be caused by faulty version of Anaconda 2.5.0, after downgrading to Anaconda 2.4.1 (or upgrading to Anaconda3) loadmat works properly.

这篇关于Python 停止在 loadmat 上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆