python – 仅在Spyder IDE中出现内存错误

执行以下操作会在Spyder Python IDE中导致MemoryError: from numpy import * a_flt = ones((7000,7000), dtype=float64)+4 b_flt = ones((7000,7000), dtype=float64)+1Traceback (most recent call l...

执行以下操作会在Spyder Python IDE中导致MemoryError:

>>> from numpy  import *
>>> a_flt = ones((7000,7000), dtype=float64)+4
>>> b_flt = ones((7000,7000), dtype=float64)+1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>    
MemoryError
>>> 

这很奇怪,因为Spyder状态栏中的内存使用情况显示只有大约.我使用了25%的记忆.此外,当在标准Python IDE GUI中生成更多这些大型7000 * 7000阵列时,一切正常.

>>> from numpy  import *
>>> a_flt = ones((7000,7000), dtype=float64)+4
>>> b_flt = ones((7000,7000), dtype=float64)+1
>>> c_flt = ones((7000,7000), dtype=float64)+1
>>> d_flt = ones((7000,7000), dtype=float64)+1
>>> e_flt = ones((7000,7000), dtype=float64)+1 

即使创建了5个浮点数组,内存要求也只占我总内存的16GB左右.那么这不是一个真正的记忆问题.我在一个spyder谷歌组https://groups.google.com/forum/#!msg/spyderlib/qE9tiriT91s/0x3s2Aw-efMJ中找到了一个关于这个问题的类似问题,但没有提供答案.如果有人可以帮助我解决这种自相矛盾的情况真的很好.
提前致谢,
帕特里克

解决方法:

安装64位版本的Python和Spyder.这消除了我这个错误.

本文标题为:python – 仅在Spyder IDE中出现内存错误

基础教程推荐